Denis Walker

"diff" Functionality in the RIPE Database

Denis Walker

4 min read

4 You have liked this article 0 times.
2

Users often like to see the difference between two versions of an object. Some objects can be long and complex. It is not easy to look at two text versions and see what changed. We are proposing to implement a 'diff' function for the RIPE Database.


Introduction

The legacy RIPE Database software used to include a diff functionality. This could be selected by adding a keyword diff to an email subject line. It was not available through Syncupdates or via the API. A new diff function will be available in the next RIPE Database release.

Database updates

When an object gets modified in the RIPE Database, there will be two different versions of the object: the old and the new one. The acknowledgement message only confirms that the update was successful (or not). The notification messages on the other hand show the recipients what has changed by displaying the full text of the old and the new object. However, many objects, aut-num in particular, can be be very long and complex, which makes it difficult, if at all possible, for a human to recognise what changed. Many users had to resort to cut/paste the object texts into separate files and running comparison scripts on the two files.

Writing these two long object texts into the notification message was apparently not very helpful. So we propose to change the output of the notification message. The proposed output will first show a diff and then show the full text of the new object. In most cases the old version can be seen by using the recently introduced history query options --list-versions and --show-version #n . This works for all object types except person and role . The notification message for a modified object will look like this:

 ---
 
OBJECT BELOW MODIFIED:

@@ -8,4 +8,5 @@
mnt-by:         RIPE-NCC-HM-MNT
-mnt-by:        LIR-MNT
+mnt-by:        lir-MNT
changed:        unread@ripe . net 20020101
+remarks:       just added
source:         RIPE

THIS IS THE NEW VERSION OF THE OBJECT:

inetnum:      192.168.200.0 - 192.168.200.255
netname:      RIPE-NET1
descr:        /24 assigned
country:      NL
admin-c:      TP1-TEST
tech-c:       TP1-TEST
status:       ASSIGNED PI
mnt-by:       RIPE-NCC-HM-MNT
mnt-by:       lir-MNT
changed:      unread@ripe . net 20020101
remarks:      just added
source:       RIPE

The old object can be seen in the history using the query options --list-versions and --show-version 1 192.168.200.0 - 192.168.200.255

This will be the default output for a notification when an object is modified. For creation and deletion of objects there will be no change to the current notification message.

Database history queries

Users can now also query for the history of objects. We propose to add a diff functionality to compare any two versions of an object with a new history query option --diff-versions #a:#b . The diff output will be in the same format as for update notifications.

 $ whois --diff-versions 2:3 192.168.0.0 - 192.169.255.255
 

----

% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Difference between version 2 and 3 of object "192.168.0.0 - 192.169.255.255"

@@ -10,3 +10,3 @@
mnt-lower:      LIR-MNT
-remarks:        version 2
+remarks:        version 3
source:         TEST # Filtered

% This query was served by the RIPE Database Query Service version 0.1-ENDTOEND (UNDEFINED)

Note that this is the standard Unix diff functionality. If you ask for --diff-versions 2:3 you will get the differences for a change from version 2 to version 3. If you ask for --diff-versions 3:2 you will get the differences for a change from version 3 to version 2. This is the reverse change so '+' and '-' will be reversed:

 @@ -10,3 +10,3 @@
 
mnt-lower:      LIR-MNT
-remarks:        version 3
+remarks:        version 2
source:         TEST # Filtered

 

Conclusion

We propose to re-introduce a diff functionality in the RIPE Database which will make it easier to compare two versions of an object. This functionality will be implemented in the next software release.

4 You have liked this article 0 times.
2

You may also like

View more

About the author

From 2001 to 2015 I was a developer and then the business analyst for the RIPE Database with the RIPE NCC. During this time I have been involved in every aspect of it's design and development of the software, web services and infrastructure, it's philosophy, legal, political and policy aspects, documentation, testing and future planning and specifying of new features

Comments 2