Skip to content

chore(ci): create PRs not push #2226

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

Closed

Conversation

heitorlessa
Copy link
Contributor

@heitorlessa heitorlessa commented May 8, 2023

Issue number: #2210

No longer necessary, closing shortly

Broken down into multiple PRs to ease reviewing (in order):

Summary

Move to new model of creating PR for specific staged changes

Changes

Please provide a summary of what's being changed

  • Build changelog on push
  • Create PR for docs
  • Remove PR permission for jobs that don't need it
  • Require PR_TITLE only... use the same for commit message
  • Defensively bump version from each step
  • Create version bump PR from release
  • Drop redundant Changelog job
  • Breakdown post_release job to reduce permissions
    • one job to bump version and create PR
    • one job to notify issues, discussions, PRs that a new version is up
  • Create docs PR with newest Layer ARN as part of the release to keep trunk up-to-date

Optional

Leave that aside, we need a tech debt issue to prevent this PR to become difficult to review.

  • Setup git client script and replace Git client setup and refresh tip job step everywhere
  • Remove detached mode steps since we no longer run the workflow as part of the release event

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@heitorlessa heitorlessa requested a review from a team as a code owner May 8, 2023 13:39
@heitorlessa heitorlessa requested review from leandrodamascena and removed request for a team May 8, 2023 13:39
@boring-cyborg boring-cyborg bot added the github-actions Pull requests that update Github_actions code label May 8, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 8, 2023
@heitorlessa heitorlessa marked this pull request as draft May 8, 2023 13:40
@github-actions github-actions bot added the internal Maintenance changes label May 8, 2023
@heitorlessa
Copy link
Contributor Author

heitorlessa commented May 8, 2023

Found a problem we can discuss tomorrow in more detail on best way to approach it.

  1. We update Layer ARNs as soon as Prod Layers are deployed - that is: docs/index.md, examples/**
  2. We build a new versioned documentation with these files that are already available in the trunk (develop), since new customers should see the latest ARN
  3. Versioned docs are built from the latest tip available in develop so we can't build a versioned doc with staged changes, at least not by depending on reusable_publish_docs.yml workflow

This will fail in the new secure model, because you won't be able to push directly - docs/index.md and examples - so the versioned docs will be built using the previous Layer ARN.

Don't have a good idea for that yet, so leaving it here for discussion.


Known constraints

  • We can't call a reusable workflow from a step, it must be a dedicated job
  • Our reusable docs publishing workflow will always pick up from the latest tip in trunk

Avenues that are possible as of now

  • We can push to github-pages branch just like before
  • We now create a PR with docs/index.md and examples separately either way
  • We could extend our docs publishing workflow to conditionally checkout from a branch instead
    • We create a temp branch with the changes and a PR already

@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 10, 2023
summary:

extend publish_docs to support git reference (temp branch id)
make reusable_update_v2_layer_arn_docs redundant
lower permissions
@heitorlessa
Copy link
Contributor Author

heitorlessa commented May 10, 2023

Found a problem we can discuss tomorrow in more detail on best way to approach it.

1. [We update Layer ARNs as soon as Prod Layers are deployed](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/.github/workflows/reusable_deploy_v2_layer_stack.yml?rgh-link-date=2023-05-08T14%3A24%3A29Z#L153) - that is: `docs/index.md`, `examples/**`

2. [We build a new versioned documentation](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/.github/workflows/publish_v2_layer.yml?rgh-link-date=2023-05-08T14%3A24%3A29Z#L144) with these files that are already available in the trunk (`develop`), since new customers should see the latest ARN

3. Versioned docs are built from the latest tip available in `develop` so we can't build a versioned doc with staged changes, at least not by depending on `reusable_publish_docs.yml` workflow

This will fail in the new secure model, because you won't be able to push directly - docs/index.md and examples - so the versioned docs will be built using the previous Layer ARN.

Don't have a good idea for that yet, so leaving it here for discussion.

Known constraints

* We can't call a reusable workflow from a step, it must be a dedicated job

* Our reusable docs publishing workflow will always pick up from the latest tip in trunk

Avenues that are possible as of now

* We can push to github-pages branch just like before

* We now create a PR with `docs/index.md` and `examples` separately either way

* We could extend our docs publishing workflow to conditionally checkout from a branch instead
  
  * We create a temp branch with the changes and a PR already

problem solved!!

I extended the workflow that publish documentation to optionally pull from a different branch or commit ID. Then, I separated creating a PR for docs, and then updating the docs like we used to but now using the temporary branch that hasn't yet being merged.

This PR is quite critical and might be easy to overlook a few areas, so I'll break this PR down now that I've got a working solution.

I'll create separate PRs for:

  • Bringing in the new composite action to create PRs - updating Changelog to act as a first example
  • Bump the project's version in the trunk via PR
  • Repurpose this PR to focus on creating a PR for latest Layer ARNs
  • Document workflows for a big picture

@heitorlessa
Copy link
Contributor Author

First PR created: #2238

@heitorlessa
Copy link
Contributor Author

heitorlessa commented May 11, 2023

@ghost
Copy link

ghost commented May 12, 2023

Interessante...

@leandrodamascena
Copy link
Contributor

This PR is no longer necessary, closing shortly

Broken down into multiple PRs to ease reviewing (in order):

  1. chore(ci): bump package version after release via pull request #2239
  2. chore(ci): bump package version after release via pull request #2239
  3. chore(ci): update layer ARN docs and create PR during release #2240

@heitorlessa 1 and 2 are the same, is this right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github-actions Pull requests that update Github_actions code internal Maintenance changes size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants