-
Notifications
You must be signed in to change notification settings - Fork 21
chore(ci): add submodules and update release process #221
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
Conversation
…tion into chore/release
…tion into chore/release
…tion into chore/release
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 looks nice!! GG
First pass, I have a few questions:
- Can we list somewhere what are the manual/automated parts of the submodules/releases?
- Should we push generated code?
- Will it be generated by the CI?
- In whose name the code is pushed?
@@ -0,0 +1,21 @@ | |||
name: Submodule | |||
|
|||
description: Update submodules |
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.
Can we add here why we need this action?
|
||
inputs: | ||
token: | ||
description: GitHub Token |
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.
Do we need specific ACLs?
@@ -0,0 +1,9 @@ | |||
[submodule "clients/algoliasearch-client-java-2"] |
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.
Is there a branch to specify somewhere?
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.
ah ok it's in the config, make sense
@@ -0,0 +1,77 @@ | |||
## Add a submodule |
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 think the doc PR will be merged before this one, you can maybe prepare a second branch based on it to avoid merge conflicts
docs/submodules.md
Outdated
```sh | ||
git submodule add [email protected]:algolia/algoliasearch-client-javascript.git clients/algoliasearch-client-javascript | ||
|
||
(cd clients/algoliasearch-client-javascript && git checkout -b next) | ||
|
||
git add clients/algoliasearch-client-javascript | ||
git commit -m "chore: add submodule" | ||
``` |
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.
We should have the usage with placeholders (e.g.: git submodule add [email protected]:algolia/<YOUR_API_CLIENT_REPOSITORY>.git
) first and then a concrete example
Then modify something and push to its origin. | ||
|
||
```sh | ||
vi README.md |
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.
:yes: vi
> code
:yes:
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 cannot believe I actually wrote vi
😂 (didn't realize it until now)
"gitAuthor": { | ||
"name": "api-clients-bot", | ||
"email": "[email protected]" | ||
} |
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.
is it the author of the release only? Who pushes to the submodules?
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.
process-release.ts
does all the commits and pushes.
@@ -65,6 +65,18 @@ export function splitGeneratorKey(generatorKey: string): Generator { | |||
return { language, client, key: generatorKey }; | |||
} | |||
|
|||
export function getGitHubUrl(lang: string): string { | |||
const entry = Object.entries(openapitools['generator-cli'].generators).find( |
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.
const entry = Object.entries(openapitools['generator-cli'].generators).find( | |
const [key, generatorOptions] = Object.entries(openapitools['generator-cli'].generators).find( |
or whatever the name is would make it clearer than entry
imo
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.
not practically, but technically entry can be nullable.
…tion into chore/release extraheader = AUTHORIZATION: bearer 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
✔️ Deploy Preview for api-clients-automation canceled. 🔨 Explore the source changes: 73391de 🔍 Inspect the deploy log: https://app.netlify.com/sites/api-clients-automation/deploys/6220960df53f9400078a4353 |
I will create a new PR to update the documentation.
No
Yes
It's specified in |
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.
Amazing ! Is there a way to see the generated code on each PR ?
`You can run this script only from \`${MAIN_BRANCH}\` branch.` | ||
); | ||
} | ||
if (process.env.SKIP_VALIDATION !== '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.
Can you export this variable as boolean from common.ts
pls ?
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.
Actually I'm supposed to remove this!
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.
We only generate clients only on release now. But if we want to generate on each PR, then I guess that's another flow we might invest on. (For example, GitHub Action triggered on new PR, generates client, and pushes it to a temp branch, and comments the links in the PR) |
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.
We should not merge if we don't want to lose the file history before the end of the investigation
ah shoot |
haha, but it's okay. we don't lose the history yet. |
I'll come back with another PR to keep the histories properly. To give you an idea:
then it's done |
* chore: provide token to checkout submodule * chore(ci): remove pipe function * chore(ci): set author identity * chore(ci): set git config globally * chore(ci): update monorepo after submodule changes * chore: update submodules * chore(ci): fix copy path * chore: update submodules * chore: update submodule * chore(ci): fix copy command * chore(ci): fix copy * chore: update submodules * chore(ci): fix copy command * chore: update submodules * chore: update submodules * chore(ci): update script * chore: update submodules * chore: remove dummy submodule * chore: remove generated clients * chore(ci): set up real submodules * chore: re-apply changes * chore: support real submodules * chore: update released tag * docs: update submodules.md * chore: update reference to js client * chore: update workspace config * chore: update issue template * chore: update issue template * chore: update submodule after checking out * chore: fix script * chore: update reference to js client * chore: update yarn workspace * chore: update reference to js client * docs: update guide * chore: update submodule * chore: add log * fix: fix clientPath * add log * add log * chore: add log * chore: try something else * chore: test * chore: remove log * chore: remove javascript repo from submodule * chore: add javascript repo as submodule again * chore: update reference to js repo * chore: update reference to submodules * chore: fix changelog path * chore: configure git author in submodules before commiting * chore: add debug code * chore: fix client path * chore: make it fail-safe * chore: fetch tag before updating it * chore: update reference to submodule * chore: fix GHA * chore: fix broken GHA * chore: provide token as env var * chore: move submodule related logic out of action.yml * chore: extract as actions/submodule * chore: add missing properties * chore: fix submodule action * chore: adding composite * chore: remove unused env var * chore: update reference to submodule * docs: update submodules.md * chore: update description of GHA * chore: fix GHA lint error * chore: fix yaml lint error * chore: remove debugging code Co-authored-by: api-clients-bot <[email protected]>
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-298
Changes included: