Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump_dependency.bash should create pull requests in topological order #585

Open
scpeters opened this issue Dec 4, 2021 · 2 comments
Open

Comments

@scpeters
Copy link
Contributor

scpeters commented Dec 4, 2021

The bump_dependency.bash iterates over a list of packages and their dependents to bump versions. It currently iterates over the dependent packages in alphabetical order, but it would be better to iterate in topological order. For #554 I ran the script multiple times to select packages at the appropriate topological level.

# order in which script presented packages for pull requests
ign-msgs
ign-fuel-tools
ign-gazebo
ign-gui
ign-launch
ign-sensors
ign-transport
ign-garden

The first time through, I selected the ign-msgs pull requests and waited. Once those were merged, I selected ign-fuel-tools and ign-transport and ended the script. I ran it again and selected ign-gui and ign-sensors and ended the script. It would be convenient to run the script once and pause at each topological level to wait for pull requests to be reviewed and merged.

@methylDragon
Copy link
Contributor

As an interim solution to this issue, to aid in topological ordering of larger dependency trees, I wrote a python script to generate topological level-groups of packages on gazebodistro (with each group constituting a set of PRs to merge.)

Following the script's outputs, it should guarantee (I hope..) PR merging safety (thought it might momentarily break downstream packages, as expected.)

But it might be less efficient, requiring a larger number of PR batches, since there's no logic to intelligently merge PR batches across different topological levels if safe.

The script:

  • Finds the latest yaml files for any candidate libraries (dependency or bump targets)
  • Automatically resolves dependants of bump targeted libraries
  • Finds topological level of library
    • E.g. A -> B -> C (B depends on A, C depends on A). Then, A is level 2, B is level 1, C is level 0.
      • This is also true even if A -> C, as long as A -> B -> C!
    • Level is determined by length of longest path in the dependency tree.

https://gist.github.com/methylDragon/357080fda22ad73824f42a5288841131

@methylDragon
Copy link
Contributor

Example output for bump_targets: ["ign-cmake", "ign-tools", "ign-plugin", "ign-utils"]

8 ['ign-cmake']
7 ['ign-utils']
6 ['ign-tools', 'ign-math']
5 ['ign-plugin', 'ign-msgs', 'ign-common']
4 ['sdformat', 'ign-transport', 'ign-rendering']
3 ['ign-sensors', 'ign-physics', 'ign-gui', 'ign-fuel-tools']
2 ['ign-gazebo']
1 ['ign-launch', 'gazebo']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants