-
Notifications
You must be signed in to change notification settings - Fork 35
Merging pr's right after each other might fail the build #395
Comments
Nice ticket! Thank you for describing the scenario and linking the Travis CI failure. |
Hi @mockitoguy, any updates to this issue? It affects our project every once in a while: https://travis-ci.org/linkedin/ambry/builds/621384294 Another issue is that, after this happens, the build does not delete the tag it created in previous steps, leading to all builds after this one failing until a developer manually intervenes and deletes the git tag: https://travis-ci.org/linkedin/ambry/builds/621388169
Do you have any suggestions for either of these issues? |
I'll work on this. Thank you guys for reporting! |
The problem is that concurrent release builds will try to write to the master branch. Options:
Evaluation:
Thoughts? PS. We might also just fix the tag issue as reported by cgtz. This is a resonable short term solution while we're working on 2) |
Hi @mockitoguy, thank you for looking into this. For option 1., there may be still be some changes required within the shipkit plugin, since, if I'm correct, limiting the CI parallelism will not prevent new commits to the master branch, so the head may still change while performRelease is running. Does travis serialize the builds and keep the last build running, or does it immediately cancel the currently running build and start a new build on the current head? For option 2., that may be nice to avoid producing extra commits, since for projects that generate a release on every commit, this can double the number of commits, but some other projects may also prefer to have the changelog checked in. Personally, I would rather not have the version bump commits, if possible (like pinot) I agree that the intermediate solution of rolling back changes (tags, etc.) made to git on build failures, would help a lot. |
@cgtz, thank you for feedback! |
I looked into that and I don't see any low hanging fruit worth implementing at this time. When 2 builds compete for the same resource (writable master) things are bound to get wrong. Long term we have a couple of options:
However, at this time I'd like to focus on eliminating the need to write to master. |
Another theoretical option: |
Wow! Very creative idea :-) I think it is doable but I'm worried about the overall complexity of this solution. I suggest to push on the idea to avoid "release commits" on the master. |
@mockito/shipkit-developers, any thoughts/feedback about the proposed solution? |
I like that release notes are kept in git history, even if they are also released to GitHub release page. Missing a possibility to disable parallel builds in Travis for release branches only is a huge gap for me. The workaround is using |
This plugin looks interesting. Can you write a bit more how you use it? |
For https://github.com/linkedin/ambry project I wrote a new simple & opinionated plugin: https://github.com/shipkit/shipkit-auto-version We will roll it out in Ambry and see how it works out. |
We are using this plugin to release artifacts to the internal Nexus repository. We set usually:
The docs https://github.com/nemerosa/versioning are very good if you need more details. |
Thank you for the details! |
The goal is to release automatically from Travis and enable convenient merging of PRs, even if many PRs are merged concurrently (bug in Shipkit Gradle plugin: mockito/shipkit#395). - instead of using Shipkit Gradle plugin we keep most CI/CD automation inside Ambry project. This way, it is easier to configure, debug and understand. - we're using a new Gradle plugin "shipkit-auto-version". This plugin automatically deducts the version based on the most recent tag and the "version.properties" file. It is a very simple plugin, keeps the build logic simple, and keeps the Ambry build easy to maintain in the future. This PR removes following features (acceptable trade-offs, we can implement it in the future): - automated release notes generation
I will close this issue because the desired behavior can be achieved with https://github.com/shipkit/shipkit-auto-version |
Problem
Currently, the build fails if two pr's are merged right after each other, e.g. see build on travis
Details
When 2 PRs are merged in a short time, there is a chance the Travis CI builds will overlap. This will cause one of the builds to fail. Consider the sequence:
Solution
See comments in the ticket for the discussion about available options. The best approach is to stop writing to master branch during release builds. Here's how we can do it:
Implementation
There are other Gradle plugins that implement SemVer-style version bumps (most credible: https://github.com/ajoberstar/reckon). The strategies:
git describe
, e.g. 0.1.0-beta.0.1+e06c68aHow about we take a different approach and infer the version from:
Examples:
This should work well for the typical PR merge use case because there is 1 merge commit and the patch version is incremented by 1. When there are direct commits on master there will be gaps in patch versions but it's not an issue because the most important is to have a unique version.
This approach will not work when there is commit rewriting on master but this never happens (and I think GH prevents it anyway).
Architecuture
I suggest a separate plugin, in a separate repo to make the experimentation easier. This also gives us time to decide how to integrate with main Shipkit plugin. New plugin repo / plugin ID: "org.shipkit.smart-versioning"
The text was updated successfully, but these errors were encountered: