[CONTROLLER-1339] categorize YANG model changes from Helium to Lithium Created: 26/May/15  Updated: 25/Jul/23  Resolved: 29/May/15

Status: Resolved
Project: controller
Component/s: mdsal
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Colin Dixon Assignee: Colin Dixon
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive he-to-li-changed-and-added-yang-files.zip     Text File he-to-li-changed-yang-files--stat.txt     Zip Archive he-to-li-changed-yang-files.zip     Zip Archive he-to-li-changed-yang-files.zip    
Issue Links:
Blocks
blocks CONTROLLER-1300 Allow user upgrade from Helium to Lit... Resolved
External issue ID: 3377

 Description   

Right now we have no idea what YANG models changed and how. Ideally, we need a script that will take two branches/tags and then identify all YANG models that have changed in that time frame with the first goal of looking at Helium to to Lithium.



 Comments   
Comment by Colin Dixon [ 26/May/15 ]

Running this command will give you a basic idea of what yang files have changed:
./odlutils/for-all.pl odlutils/li-repos.txt 'git diff --stat release/helium..HEAD – blank `find . -name *.yang | grep -v target/ | grep -v test` | cat'

It uses the for-all.pl from here:
https://github.com/nilok/odlutils

A few notes
0.) This assumes you've checked out all the lithium repos and moved to the stable/lithium branch if there is one, something like:
./odlutils/for-all.pl --no-cd odlutils/li-repos.txt "git clone https://git.opendaylight.org/gerrit/

{f}

.git"
./odlutils/for-all.pl odlutils/li-repos.txt "git co -b stable/lithium remotes/origin/stable/lithium"
1.) The "-- blank" ensures that it will avoid logging any differences if there are no yang files because presumably the file blank doesn't exist.
2.) The "| cat" stops git from waiting for keyboard input

This won't tell you if a file was deleted or created over that period to do that I'm going to to have to write a script that uses "git cat-file -e" to test if the file exists in release/helium and HEAD.

Comment by Colin Dixon [ 26/May/15 ]

Attachment he-to-li-changed-yang-files--stat.txt has been added with description: yang files that have changed since release/helium using git diff --stat

Comment by Colin Dixon [ 26/May/15 ]

Attachment he-to-li-changed-yang-files.zip has been added with description: yang files that have changed since release/helium using git diff

Comment by Colin Dixon [ 26/May/15 ]

I've attached the results from running the above command with diff (as a zip file) and diff --stat (as a txt file). They should help start to answer the questions.

The result of that is that only 15 projects changed, added, or deleted any yang files:
aaa 6
bgpcep 19
controller 32
groupbasedpolicy 23
lispflowmapping 8
openflowjava 11
openflowplugin 44
ovsdb 6
packetcable 4
sdninterfaceapp 15
sfc 29
ttp 2
vtn 14
yangtools 5

For silly reasons, that actually the number of changed yang files + 1 in each case since it's "git diff | wc -l" which includes the one line of summary.

Comment by Colin Dixon [ 28/May/15 ]

I finally got a script that does more or less what you'd want and attached a zip file of it's output both of just a list of files as well as providing diffs for the files that changed using "git diff" and "git diff --stat".

Comment by Colin Dixon [ 28/May/15 ]

Attachment he-to-li-changed-and-added-yang-files.zip has been added with description: a list of added and changed models from release/helium to stable/lithium

Comment by Colin Dixon [ 29/May/15 ]

Here's a script which you can use to get lists of the models that were added/changed and/or removed between two arbitrary points in git history. It will also optionally give you the output for "git diff" or "git diff --stat" for the models that changed.

https://git.opendaylight.org/gerrit/#/c/21381/

You can run it over all projects by combining it with the odlutils/for-all.pl script here:
https://github.com/nilok/odlutils

Once the above patch is merged, this should work from scratch:
git clone https://github.com/nilok/odlutils.git
./odlutils/for-all.pl --no-cd odlutils/li-repos.txt 'git clone https://git.opendaylight.org/gerrit/

{f}

.git'
./odlutils/for-all.pl odlutils/li-repos.txt 'git co -b stable/lithium remotes/origin/stable/lithium'
./odlutils/for-all.pl odlutils/li-repos.txt '../autorelease/scripts/changed-models.pl --diff release/helium && echo'

That whole process on my laptop takes just under 3 minutes from scratch and 15 seconds over all the projects in OpenDaylight if you already have them cloned and on the master or stable/lithium branches as appropriate.

Comment by Colin Dixon [ 29/May/15 ]

I updated the lists to use the new lithium repos (removing discovery and plugin2oc) as well as adding support for tracking deleted models.

Comment by Colin Dixon [ 29/May/15 ]

Attachment he-to-li-changed-yang-files.zip has been added with description: added, deleted, and changed yang files from helium to lithium

Generated at Wed Feb 07 19:55:17 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.