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

CI Branching #27

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Thiyagu55
Copy link
Contributor

  • Whenever any code is pushed into python/java/ruby/nodejs folder's main branch this GitHub workflow will merge the changes into python/java/ruby/nodejs sqlcommenter branch respectively

@weyert
Copy link

weyert commented Dec 24, 2021

I can see this working :)

@sjs994 sjs994 requested a review from aabmass January 3, 2022 15:17
@sjs994
Copy link
Contributor

sjs994 commented Jan 3, 2022

To give some context: This is a monorepo with multiple languages.
So a normal release would:

  1. put java, nodejs, python and ruby code in the same artifact tarball.
  2. we can't independently release a particular language library.

What we were thinking with this PR is

  1. to have separate branches for different languages.
  2. When changes are done to a particular language path, on merge, we will copy the changes to particular branch e.g. changes to sqlcommenter-python/** on merging would trigger a workflow to copy the content into python-sqlcommenter branch.
  3. Then we can release different language libraries from their respective branches, which will trigger workflows to publish libraries to respective repositories.

@aabmass @lonewolf3739 Do you guys see any concerns with this approach ?

@sjs994 sjs994 requested a review from srikanthccv January 3, 2022 15:33
@srikanthccv
Copy link
Member

I don't see any immediate concerns with this approach. Since there is one workflow for each lang would it be possible to do this in main branch itself?

@sjs994
Copy link
Contributor

sjs994 commented Jan 5, 2022

I don't see any immediate concerns with this approach. Since there is one workflow for each lang would it be possible to do this in main branch itself?

yes, we can do it from main branch but it has its pros and cons.

  1. We can have multiple workflows depending on different paths. Now, if we release from main branch, then the workflows would be triggered at the same time. So on a single release, we will have 4 deployments to pypi, npm, sonatype(java) and marginalia(ruby). Also the assets generated would contain all language libraries.
  2. As the previous ways do not allow us to release a single language library. So, we can use tags during release and have conditions set to release particular language library using tags.
    For Ex: if tag like 'java-sqlcommenter-%' use java-workflow.yml.
    With this, we can release particular language library, but still our release assets will contains the whole code as we don't have control on what to add to assets.

Now, this approach of creating release from branches would mitigate the assets part, where python release would only contain python sources and so for other languages.
But there is one problem with this approach, that is the release branch by default allow git push directly. Anyone can push changes to that. If we lock it, github actions can't force push the changes automatically and would require robot account to make those branches secure. Exploring if there are other ways like using a DEPLOY_TOKEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants