-
Notifications
You must be signed in to change notification settings - Fork 40
Decouple sync and release actions #84
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: localstack
Are you sure you want to change the base?
Conversation
9296029 to
09bb5a6
Compare
09bb5a6 to
784afee
Compare
784afee to
cd247e5
Compare
cd247e5 to
da5ff9f
Compare
da5ff9f to
398e6c9
Compare
398e6c9 to
2abe8b3
Compare
2abe8b3 to
51c9653
Compare
d12ab58 to
09b865f
Compare
09b865f to
2976974
Compare
2976974 to
bf2db95
Compare
bf2db95 to
4823bfa
Compare
4823bfa to
34212d7
Compare
34212d7 to
d37abda
Compare
alexrashed
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.
Thanks for jumping on this! Great to see the sync being decoupled to support the future strategy. I only added a few small questions, mostly because I might not fully understand how the release cycles and the upgrade path of LocalStack is going to look like in the future... 😅
| schedule: | ||
| - cron: 0 5 * * MON |
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.
question: given that we do not have a schedule on the "sync" workflow anymore, does it make sense to have a weekly schedule on this one? Hopefully there won't be any commits in the repo in most weeks? Wouldn't this pipeline fail now if there are no commits fora whole week?
Or are there automated changes similar to #86 created by new automations strictly every single week?
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.
The plan is to stick to the same schedule as in Moto for updating the static data. One of the workflows actually scrapes info off the AWS docs website.
Some workflows run weekly, others monthly (see table in PNX-557 for the schedule)
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.
Okay, that makes sense. But are there for sure always changes every week? If not, this workflow would fail, right?
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.
It won't for sure change every week.
The workflow won't fail if that's the case, it'll make a 'duplicate' release with a bumped version.
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.
Ah, okay. That sounds good enough, but is that something that we want though? Would it maybe make sense to just gracefully stop the action (with a successful outcome) if the current commit is already tagged / released?
I think that fact ("duplicate releases") could be a bit confusing, and we wouldn't unnecessarily invalidate caches, pollute PyPi,... WDYT?
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.
Interesting you mention this - I was actually considering whether we should change to CalVer because of the planned weekly releases of Moto-Ext but decided against it.
With regards to not releasing if there are not commits, I will add a conditional skip if git log <latest tag>..HEAD is empty. But this won't fully protect against duplicate releases e.g. when changes are made only in .github
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.
Interesting you mention this - I was actually considering whether we should change to CalVer because of the planned weekly releases of Moto-Ext but decided against it.
Well, I guess both could be valid, switching to calendar versioning but just not creating releases if there are no changes would also be an option (without saying that I would be in favor of doing that). 😅
With regards to not releasing if there are not commits, I will add a conditional skip if git log ..HEAD is empty. But this won't fully protect against duplicate releases e.g. when changes are made only in .github
Sounds good, and I think this approach would be good enough :)
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.
Added in 129b906
| - name: Guess next version | ||
| id: semver | ||
| uses: "WyriHaximus/github-action-next-semvers@v1" | ||
| with: | ||
| version: ${{ steps.previous.outputs.tag }} |
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.
question: How is this version determined and what do we expect the next few version numbers to look like?
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.
The previous action retrieves the latest Git tag. This action provides incremented the semantic versions, and we use the version with patch number bumped. This is because Moto-Ext is effectively feature-frozen, only a specific kind of bugfixes will be allowed.
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.
Thanks, that sounds good. I am just still a bit confused how this compares with the upstream versioning. In the other comment you mentioned that there might as well be selective pulls from upstream every now and then. How does the versioning scheme work with that?
Also, just to make sure we are talking about the same thing: When you say "micro" in the PR description, you mean "micro" as in PEP440, i.e. what you are calling "patch" here, right?
I guess my question is basically: What is the difference from the previous versioning to this kind of versioning and how is this going to look like considering the future of this project.
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.
In the other comment you mentioned that there might as well be selective pulls from upstream every now and then. How does the versioning scheme work with that?
There won't be any selective pulls. The rebase that happened this week was supposed to be the last, but because Simon and Daniel contributed to Moto upstream this week, we'll make an exception and do another rebase next week. That rebase will be the last rebase and Moto-Ext will effectively be frozen.
Since we've already announced the hard fork, I guess we can start using our own version scheme and not incorporate the minor verion bump that might come with the next week's rebase.
After this PR is merged, the version scheme will be strictly micro bumps.
When you say "micro" in the PR description, you mean "micro" as in PEP440, i.e. what you are calling "patch" here, right?
Yes, basically major.minor.micro. The term 'patch' (same meaning as 'micro') is what we use in our Semantic Versioning spec 😛
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.
Okay, thanks for the explanations, that makes sense! I guess we might cherry-pick certain commits in the future (for a while) from upstream, but I understand the next sync is going to be the last. I think my confusion came from the fact that we are keeping the sync workflow, but commit to never ever executing it again 😅
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.
question: Does it make sense to even keep this pipeline? You mentioned in the description that there is no plan to sync the fork with upstream anymore? If this is the case, I guess we could just remove this part / this workflow?
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.
We seem to need another bump (see #sig-moto) so I'd like to keep it for a while.
I'll make a separate PR in the future which cleans up this and other unused workflows from upstream.
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.
Okay, sounds good! As a nitpick on the side I would in this case also opt for renaming this workflow as well 😛
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.
nit: Might make sense to rename the workflows a bit. They don't have much to do with Continuous Integration anymore I guess 😅
alexrashed
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.
Thanks for clarifying my questions in the comment threads! That helped me understand what the next steps are and how the project and its maintenance will look like in the future. 🚀
alexrashed
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.
Thanks for jumping on the comments, but this change would now actually fail the pipeline regularly, which I don't think is the intention.
| env: | ||
| LAST_TAG: ${{ steps.previous.outputs.tag }} | ||
| run: | | ||
| [ $(git log --oneline $LAST_TAG..HEAD | wc -l) -eq "0" ] && { echo "No commits since the last tag. Nothing to release."; exit 1; } |
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.
issue: This will now explicitly fail the pipeline if there was no commit.
Usually something like this is implemented by having one job which determines if the actual task should be executed. Something like this:
jobs:
check-commits:
runs-on: ubuntu-latest
outputs:
has-new-commits: ${{ steps.check.outputs.has-new-commits }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: check
run: |
LAST_TAG=$(git describe --tags --abbrev=0)
if git rev-parse "$LAST_TAG"..HEAD >/dev/null 2>&1; then
echo "has-new-commits=true" >> $GITHUB_OUTPUT
else
echo "has-new-commits=false" >> $GITHUB_OUTPUT
fi
And then have the other job depend on it:
release:
runs-on: ubuntu-latest
needs: check-commits
if: needs.check-commits.outputs.has-new-commits == 'true'
steps:
...
Background
Moto-Ext current has an action that rebases the codebase with upstream repo and publishes the build to PyPI, introduced in #78.
Changes
Following the hard fork (see #83), Moto-Ext will not be rebased with the upstream repo. This PR therefore reworks this CI pipeline and splits it into two separate workflows:
Tests
Successful dry runs for:
Related
Closes: PNX-558