Skip to content

chore(ci): push to each repository on PR merge #257

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

Merged
merged 17 commits into from
Mar 21, 2022
Merged

chore(ci): push to each repository on PR merge #257

merged 17 commits into from
Mar 21, 2022

Conversation

eunjae-lee
Copy link
Contributor

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-371

Changes included:

Every time a PR is merged on monorepo, GitHub Action pushes the generated clients to each repository.

If a commit is language specific, for example, fix(javascript): ..., then only the js repo receives the commit (with the same commit message).
If a commit is common for all the languages, all the language repos receive the commit.

🧪 Test

  • CI

@netlify
Copy link

netlify bot commented Mar 16, 2022

✅ Deploy Preview for api-clients-automation canceled.

🔨 Explore the source changes: 73e3c04

🔍 Inspect the deploy log: https://app.netlify.com/sites/api-clients-automation/deploys/623895a7d69e860008b6a31a

@eunjae-lee eunjae-lee marked this pull request as ready for review March 16, 2022 10:44
@eunjae-lee eunjae-lee requested review from millotp and shortcuts and removed request for millotp March 16, 2022 10:44
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far!!

@shortcuts
Copy link
Member

shortcuts commented Mar 17, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the generated/main branch.

@eunjae-lee
Copy link
Contributor Author

Not sure why this error is happening. Any idea @shortcuts ? 🤔

@shortcuts
Copy link
Member

Not sure why this error is happening. Any idea @shortcuts ? 🤔

Because the checkout is sync with main, and the script does not exist on main

You can set it to this branch for the PR review, and then re-do a PR with an update for main

@eunjae-lee
Copy link
Contributor Author

Because the checkout is sync with main, and the script does not exist on main

You can set it to this branch for the PR review, and then re-do a PR with an update for main

ahah good catch

@eunjae-lee
Copy link
Contributor Author

@shortcuts Your comment got me realized that this check is running not only main but also on PRs, and I need it to be run only on main, so 9a38b2d

@shortcuts
Copy link
Member

@shortcuts Your comment got me realized that this check is running not only main but also on PRs, and I need it to be run only on main, so 9a38b2d

Indeed, and should also contain this clause: needs.codegen.result == 'success', otherwise always() will make it run even if it fails or is skipped

@eunjae-lee
Copy link
Contributor Author

I think the principal author will be api-clients-bot and the real author only the co-author, but we will see soon enough

I didn't know about this. I'll apply it here soon.

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good!!! Only one last comment :D

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goooood!

@eunjae-lee eunjae-lee enabled auto-merge (squash) March 21, 2022 15:18
@eunjae-lee eunjae-lee merged commit 2583871 into main Mar 21, 2022
@eunjae-lee eunjae-lee deleted the chore/push branch March 21, 2022 15:23
shortcuts pushed a commit that referenced this pull request Apr 22, 2022
* chore(ci): push to each repository on PR merge

* chore: separate spreadGeneration workflow

* chore: remove unnecessary eslint disable comment

* chore: rename workflow

* chore: adjust abstraction

* chore: include PR url in commit message

* chore: move generation workflow to after codegen

* chore: spread generation only on main

* chore: spread generation only when codegen is successful

* chore: spread generation as a part of codegen

* chore: apply author name and email to commits

* chore: include coauthor in commit message

* chore: add tests

* chore: add tests
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.

2 participants