You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR introduces a series of JS scripts under .github/scripts/*. These scripts have been lifted from the Powertools for Python repo.
Workflows
This PR introduces also a few workflows and updates others related to PRs, namely:
One single workflow called record_pr.yml is now run as a result of an opened, modified (description/title only - not code), closed PR. This workflow runs and generates an artefact containing the PR details (i.e. title, number, etc.). This artefact is then used by the subsequent workflows.
A second workflow called label_pr_on_title.yml is run as result of the successful execution of the record_pr.yml. It uses the generated artefact to obtain the details of the PR (via reusable_export_pr_details.yml) and it labels the PR based on the title. Given that this workflow must have somewhat privileged permissions to label the PR, the new invocation mechanism makes it so that the workflow runs only when called on the original repo (see details here)
A third workflow called on_opened_pr.yml is run as result of the successful execution of the record_pr.yml. It uses the generated artefact to obtain the details of the PR (via reusable_export_pr_details.yml) and it tries to find an Issue number in the PR description. PRs that don't have a related issue are then labeled as blocked. This is to avoid having PRs that come without a previous discussion - like detailed in the CONTRIBUTING guidelines.
The fourth workflow, called on-merge-to-main.yml already existed and it has now been edited to incorporate a mechanism that labels an issue related to a PR as pending-release.
See diagram below for visual representation of the workflows:
flowchart TB
A[PR Opened / edited / closed - record_pr.yml runs] -->|Extract PR details - scripts/save_pr_details.js| B[Artifact pr.txt is generated]
B -->|Label PR| C[label_pr_on_title.yml]
C -->|Get PR details/artifact - reusable_export_pr_details.yml| D[Adds label to PR if any relevant - label_pr_based_on_title.js]
B -->|Find related Issue| E[on_opened_pr.yml]
E -->|Get PR details/artifact - reusable_export_pr_details.yml| F[Adds label only to new PRs if no linked issue is present in PR body - label_missing_related_issue.js]
B -->|Label related Issue| G[on-merge-to-main.yml]
G -->|Get PR details/artifact - reusable_export_pr_details.yml| H[Adds label to linked issue when PR is merged - label_related_issue.js]
Loading
Codeowners
The file now points to the team @awslabs/aws-lambda-powertools-typescript that also governs access to the repo.
For additional context, the version of the file present on main had an invalid/outdated format as well as a #todo item with a reminder to change it.
Lerna
The repo has a file called lerna.json, this file is used to specify which packages/folders should be managed by lerna. Previous to this PR all folders under packages/* were included, this PR makes it explicit which folders should be included.
This will come in handy once we start merging PRs that include unreleased utilities or utilities that are not ready to be included as a part of the CI.
PR Template
The section titled Related issues, RFCs has been updated to now point to a single issue with the following format:
<!--- Add here the number to the Github Issue or RFC that is related to this PR. --><!-- **Issue number:** #123 -->**Issue number:**
This change is aimed at helping the workflow defined above to find the related issue.
How to verify this change
See newly introduced workflows run on PR created/updated/closed
🤖 This report was automatically generated by pkg-size-action
(options hash: 27647e0596d2c826c9298aca55295e28)
dreamorosi
changed the title
chore(ci): housekeeping scripts & workflows related to merge
chore(ci): housekeeping scripts & workflows related to PRs
Jul 23, 2022
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I won't be able to understand these scripts without the PR's description. Would it be beneficial to copy that (including the nice visual diagram) into .github/workflows/README.md?
I won't be able to understand these scripts without the PR's description. Would it be beneficial to copy that (including the nice visual diagram) into .github/workflows/README.md?
Very good point, I have created an issue (#1038) to track this action item.
automationThis item relates to automationinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
Scripts
This PR introduces a series of JS scripts under
.github/scripts/*
. These scripts have been lifted from the Powertools for Python repo.Workflows
This PR introduces also a few workflows and updates others related to PRs, namely:
record_pr.yml
is now run as a result of an opened, modified (description/title only - not code), closed PR. This workflow runs and generates an artefact containing the PR details (i.e. title, number, etc.). This artefact is then used by the subsequent workflows.label_pr_on_title.yml
is run as result of the successful execution of therecord_pr.yml
. It uses the generated artefact to obtain the details of the PR (viareusable_export_pr_details.yml
) and it labels the PR based on the title. Given that this workflow must have somewhat privileged permissions to label the PR, the new invocation mechanism makes it so that the workflow runs only when called on the original repo (see details here)on_opened_pr.yml
is run as result of the successful execution of therecord_pr.yml
. It uses the generated artefact to obtain the details of the PR (viareusable_export_pr_details.yml
) and it tries to find an Issue number in the PR description. PRs that don't have a related issue are then labeled as blocked. This is to avoid having PRs that come without a previous discussion - like detailed in theCONTRIBUTING
guidelines.on-merge-to-main.yml
already existed and it has now been edited to incorporate a mechanism that labels an issue related to a PR aspending-release
.See diagram below for visual representation of the workflows:
Codeowners
The file now points to the team
@awslabs/aws-lambda-powertools-typescript
that also governs access to the repo.For additional context, the version of the file present on
main
had an invalid/outdated format as well as a#todo
item with a reminder to change it.Lerna
The repo has a file called
lerna.json
, this file is used to specify which packages/folders should be managed bylerna
. Previous to this PR all folders underpackages/*
were included, this PR makes it explicit which folders should be included.This will come in handy once we start merging PRs that include unreleased utilities or utilities that are not ready to be included as a part of the CI.
PR Template
The section titled
Related issues, RFCs
has been updated to now point to a single issue with the following format:This change is aimed at helping the workflow defined above to find the related issue.
How to verify this change
See newly introduced workflows run on PR created/updated/closed
Related issues, RFCs
aws-powertools/powertools-lambda-python#1350
aws-powertools/powertools-lambda-python#1352
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.