-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Add support for st2-packages branching (master) #2569
Conversation
- Autodetect st2-packages branch automatically - Make sure to suppress `git checkout` error code to avoid race, when remote `st2-packages` branch wasn't yet created - Fall-back to `st2-packages` master if there is no `vX.Y` branch in packages
- | | ||
git clone --depth 1 ${ST2_PACKAGES_REPO} /home/ubuntu/st2/st2-packages | ||
cd /home/ubuntu/st2/st2-packages | ||
git checkout ${CIRCLE_BRANCH} || true |
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.
Here we suppress git checkout
error code to avoid race, when remote st2-packages
branch wasn't created yet.
So it works as a fall-back to default master
branch if there is no vX.Y
branch in packages.
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 thought of that, but what bothers me is that we're implicitly treating master as default. There's a whole set of situations when mistake may cost us putting broken package to the repo. As I see it, if we don't have a sister branch, we fail, loud.
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.
Yeah, but it's circular dependency:
- You can't build packages in
st2
repo before you create branch inst2-packages
repo - You can't build packages in
st2-packages
repo before you create branch inst2
repo
So master
is a fallback here.
As I know current release machinery works this way:
- Create
vX.Y
branch inst2
repo - Create
vX.Y
branch in dependent repos likest2web
(st2-packages
to add)
With this order checkout branch which wasn't yet created in st2-packages
repo will raise an error in Circle.
^^ @manasdk is this order correct or no? (to make sure we have correct picture and if needed - I'll adjust the logic here).
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.
Well, yes, it is a circular dependency and yes, there's no way to resolve it without failing or falling back to master. My point is that it's better to fail because failing has no side effects.
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'm still hoping someday we would just merge st2 and st2-packages and forget about this problem once and for 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.
^^
Yeah, initially, we couldn't think seriously about such option at all, because we couldn't touch entire existing st2
codebase and release machinery with our st2-packages
changes.
So we kept that package logic isolated in new repo to avoid overflowing other team members (especially considering we had a lot of experiments and pretty big code flow).
When st2-packages
matures and stabilizes, it's good to consider pros/cons again for keeping everything in one or separated repos 👍
Add support for st2-packages branching (master)
What this change brings
master
ofst2
repo will generate packages based onmaster
ofst2-packages
v1.3
ofst2
repo will generate packages based onv1.3
ofst2-packages
v1.3
branch inst2-packages
repo, thenmaster
will be used as a fallbackst2-packages
repo (st2
branch was created, butst2-packages
branch wasn't created yet)From this point
st2
andst2-packages
repos should have the same branchesvX.Y
.cc @manasdk to include automated branch creation in
st2-packages
repo as part of release machinery (same as you do forst2web
).