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

Add support for st2-packages branching (master) #2569

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

arm4b
Copy link
Member

@arm4b arm4b commented Mar 9, 2016

Part of StackStorm/st2-packages#227

What this change brings

  • pushing to master of st2 repo will generate packages based on master of st2-packages
  • pushing to v1.3 of st2 repo will generate packages based on v1.3 of st2-packages
    • If there is no v1.3 branch in st2-packages repo, then master will be used as a fallback
    • ^^ This race case would happen after automating branch creation in st2-packages repo (st2 branch was created, but st2-packages branch wasn't created yet)

From this point st2 and st2-packages repos should have the same branches vX.Y.

cc @manasdk to include automated branch creation in st2-packages repo as part of release machinery (same as you do for st2web).

- 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
Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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 in st2-packages repo
  • You can't build packages in st2-packages repo before you create branch in st2 repo

So master is a fallback here.

As I know current release machinery works this way:

  • Create vX.Y branch in st2 repo
  • Create vX.Y branch in dependent repos like st2web (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).

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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 👍

@arm4b arm4b added the feature label Mar 9, 2016
arm4b pushed a commit that referenced this pull request Mar 11, 2016
Add support for st2-packages branching (master)
@arm4b arm4b merged commit 7d2cc63 into master Mar 11, 2016
@arm4b arm4b deleted the feature/st2-packages-branching branch March 11, 2016 12:55
This was referenced Mar 25, 2016
@cognifloyd cognifloyd removed the RFR label Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants