-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use dry runs to avoid destroying data in release repos #45263
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
base: master
Are you sure you want to change the base?
Conversation
migration-tools/migrate-rosdistro.py
Outdated
| subprocess.check_call(['git', 'push', 'origin', '--tags', '--dry-run']) | ||
| subprocess.check_call(['git', 'push', 'origin', 'upstream', '--force']) | ||
| subprocess.check_call(['git', 'push', 'origin', '--all', '--dry-run']) | ||
| subprocess.check_call(['git', 'push', 'origin', '--tags', '--all']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be split since --all and --tags can't both be used. There's a synonym --branches for --all that may be easier to read.
migration-tools/migrate-rosdistro.py
Outdated
| # 3. Ensure we're not overwriting any branches | ||
| # 4. Push the branches and tags | ||
| subprocess.check_call(['git', 'push', 'origin', '--tags', '--dry-run']) | ||
| subprocess.check_call(['git', 'push', 'origin', 'upstream', '--force']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are situations where upstream/* tags may also technically be changed between releases which would result in an inconsistent state between the current upstream state and the previous tag but the only real-world examples I know of were in the early ROS 2 days with fastrtps and thankfully it doesn't happen any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this requires action right away. It's a hint in case this change creates additional unexpected failures pushing other upstream tags.
nuclearsandwich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a suggestion which I'm pretty sure is a required change and clarified that the other comment is an observation rather than something actionable.
migration-tools/migrate-rosdistro.py
Outdated
| subprocess.check_call(['git', 'push', 'origin', '--tags', '--dry-run']) | ||
| subprocess.check_call(['git', 'push', 'origin', 'upstream', '--force']) | ||
| subprocess.check_call(['git', 'push', 'origin', '--all', '--dry-run']) | ||
| subprocess.check_call(['git', 'push', 'origin', '--tags', '--all']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting my observation into suggestion.
| subprocess.check_call(['git', 'push', 'origin', '--tags', '--all']) | |
| subprocess.check_call(['git', 'push', 'origin', '--tags']) | |
| subprocess.check_call(['git', 'push', 'origin', '--branches']) |
cc70677 to
c8052d9
Compare
If something goes wrong, use dry run pushes to ensure we don't destroy any data in the repository.
upstreambranch. This is the ONLY branch we should ever force-push, and is an intermediate staging branch anyway.!!! I haven't actually tested this yet