Skip to content

docs(maintainers): initial maintainers playbook #1222

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 19 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ body:
attributes:
value: |
Thank you for submitting a bug report. Please add as much information as possible to help us reproduce, and remove any potential sensitive data.

Please become familiar with [our definition of bug](https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/MAINTAINERS.md#is-that-a-bug).
- type: textarea
id: expected_behaviour
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/static_typing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Static typing mismatch report
description: Report a static type mismatch caught by a static type checker
title: "Static typing: TITLE"
labels: ["static_typing", "triage"]
labels: ["typing", "triage"]
body:
- type: markdown
attributes:
Expand Down
8 changes: 0 additions & 8 deletions .github/auto_assign-issues.yml

This file was deleted.

57 changes: 37 additions & 20 deletions .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,84 @@
##### Labeler ##########################################################################################################
labelPRBasedOnFilePath:
area/logger:
logger:
- aws_lambda_powertools/logging/*
- aws_lambda_powertools/logging/**/*
- aws_lambda_powertools/package_logger.py
area/tracer:
tracer:
- aws_lambda_powertools/tracing/*
- aws_lambda_powertools/tracing/**/*
area/metrics:
metrics:
- aws_lambda_powertools/metrics/*
- aws_lambda_powertools/metrics/**/*
area/event_handlers:
event_handlers:
- aws_lambda_powertools/event_handler/*
- aws_lambda_powertools/event_handler/**/*
area/middleware_factory:
middleware_factory:
- aws_lambda_powertools/middleware_factory/*
- aws_lambda_powertools/middleware_factory/**/*
area/parameters:
parameters:
- aws_lambda_powertools/parameters/*
- aws_lambda_powertools/parameters/**/*
area/batch:
batch:
- aws_lambda_powertools/batch/*
- aws_lambda_powertools/batch/**/*
area/validator:
validator:
- aws_lambda_powertools/validation/*
- aws_lambda_powertools/validation/**/*
area/event_sources:
event_sources:
- aws_lambda_powertools/data_classes/*
- aws_lambda_powertools/data_classes/**/*
area/parser:
parser:
- aws_lambda_powertools/parser/*
- aws_lambda_powertools/parser/**/*
area/idempotency:
idempotency:
- aws_lambda_powertools/idempotency/*
- aws_lambda_powertools/idempotency/**/*
area/feature_flags:
feature_flags:
- aws_lambda_powertools/feature_flags/*
- aws_lambda_powertools/feature_flags/**/*
area/jmespath_util:
jmespath_util:
- aws_lambda_powertools/utilities/jmespath_utils/*
area/utilities:
typing:
- aws_lambda_powertools/utilities/typing/*
- mypy.ini
utilities:
- aws_lambda_powertools/utilities/*
- aws_lambda_powertools/utilities/**/*
- aws_lambda_powertools/middleware_factory/*
- aws_lambda_powertools/middleware_factory/**/*

documentation:
- docs/*
- docs/**/*
- mkdocs.yml

github-actions:
- .github/workflows/*
- .github/workflows/**/*
- .github/dependabot.yml
- .github/boring-cyborg.yml
- .github/release-drafter.yml
- .github/semantic.yml
- .github/stale.yml
- .github/mergify.yml

github-templates:
- .github/ISSUE_TEMPLATE/*
- .github/PULL_REQUEST_TEMPLATE.md
- .github/.chglog/*
- .github/.chglog/**/*

internal:
- .github/*
- .github/**/*
- .chglog/*
- .flake8
- .bandit.baseline
- .gitignore
- .pre-commit-config.yaml
- MANIFEST.in
- Makefile
- CONTRIBUTING.md
- MAINTAINERS.md
- CODE_OF_CONDUCT.md
- LICENSE
- THIRD-PARTY-LICENSES
- aws_lambda_powertools_python/shared/*
- aws_lambda_powertools_python/shared/**

Expand All @@ -86,7 +104,6 @@ firstPRMergeComment: >
firstIssueWelcomeComment: >
Thanks for opening your first issue here! We'll come back to you as soon as we can.


###### IssueLink Adder #################################################################################################
# Insert Issue (Jira/Github etc) link in PR description based on the Issue ID in PR title.
#insertIssueLinkInPrDescription:
Expand Down
36 changes: 16 additions & 20 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
change-template: "* $TITLE (#$NUMBER) by @$AUTHOR"
categories:
- title: '⚡ Breaking Changes'
- title: "⚡ Breaking Changes"
labels:
- 'breaking-change'
- title: '🌟New features and non-breaking changes'
- "breaking-change"
- title: "🌟New features and non-breaking changes"
labels:
- 'major'
- 'feature'
- title: '🌟 Minor Changes'
- "feature"
- title: "📜 Documentation updates"
labels:
- 'enhancement'
- title: '📜 Documentation updates'
- "documentation"
- title: "🐛 Bug and hot fixes"
labels:
- 'documentation'
- title: '🐛 Bug and hot fixes'
- "bug"
- "fix"
- title: "🚒 Deprecations"
labels:
- 'bug'
- 'fix'
- title: '🚒 Deprecations'
- "deprecated"
- title: "🔧 Maintenance"
labels:
- 'deprecated'
- title: '🔧 Maintenance'
labels:
- 'internal'
- 'dependencies'
- "internal"
- "dependencies"
exclude-labels:
- 'skip-changelog'
tag-template: 'v$NEXT_PATCH_VERSION'
- "skip-changelog"
tag-template: "v$NEXT_PATCH_VERSION"
template: |
## Summary

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post_release.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const STAGED_LABEL = "status/staged-next-release";
const STAGED_LABEL = "pending-release";

/**
* Fetch issues using GitHub REST API
Expand Down
155 changes: 77 additions & 78 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name: Publish to PyPi
# 8. Builds a fresh version of docs including Changelog updates
# 9. Push latest release source code to master using release title as the commit message
# 10. Builds latest documentation for new release, and update latest alias pointing to the new release tag
# 11. Close and notify all issues labeled "status/staged-next-release" about the release details
# 11. Close and notify all issues labeled "pending-release" about the release details

#
# === Fallback mechanism due to external failures ===
Expand All @@ -36,7 +36,6 @@ name: Publish to PyPi
#
# Look for rebuild latest docs workflow


on:
release:
types: [published]
Expand All @@ -45,84 +44,84 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Set release notes tag
run: |
RELEASE_TAG_VERSION=${{ github.event.release.tag_name }}
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
- name: Ensure new version is also set in pyproject and CHANGELOG
run: |
grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
- name: Install dependencies
run: make dev
- name: Run all tests, linting and baselines
run: make pr
- name: Build python package and wheel
run: poetry build
- name: Upload to PyPi test
run: make release-test
env:
PYPI_USERNAME: __token__
PYPI_TEST_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }}
- name: Upload to PyPi prod
run: make release-prod
env:
PYPI_USERNAME: __token__
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: publish lambda layer in SAR by triggering the internal codepipeline
run: |
aws ssm put-parameter --name "powertools-python-release-version" --value $RELEASE_TAG_VERSION --overwrite
aws codepipeline start-pipeline-execution --name ${{ secrets.CODEPIPELINE_NAME }}
env:
# Maintenance: Migrate to new OAuth mechanism
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-1
AWS_DEFAULT_OUTPUT: json
- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email [email protected]
- name: Build docs website and API reference
run: |
make release-docs VERSION=${RELEASE_TAG_VERSION} ALIAS="latest"
poetry run mike set-default --push latest
- name: Release API docs to release version
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: ${{ env.RELEASE_TAG_VERSION }}/api
- name: Release API docs to latest
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: latest/api
- name: Close issues related to this release
uses: actions/github-script@v6
with:
script: |
const post_release = require('.github/workflows/post_release.js')
await post_release({github, context, core})
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Set release notes tag
run: |
RELEASE_TAG_VERSION=${{ github.event.release.tag_name }}
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
- name: Ensure new version is also set in pyproject and CHANGELOG
run: |
grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
- name: Install dependencies
run: make dev
- name: Run all tests, linting and baselines
run: make pr
- name: Build python package and wheel
run: poetry build
- name: Upload to PyPi test
run: make release-test
env:
PYPI_USERNAME: __token__
PYPI_TEST_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }}
- name: Upload to PyPi prod
run: make release-prod
env:
PYPI_USERNAME: __token__
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: publish lambda layer in SAR by triggering the internal codepipeline
run: |
aws ssm put-parameter --name "powertools-python-release-version" --value $RELEASE_TAG_VERSION --overwrite
aws codepipeline start-pipeline-execution --name ${{ secrets.CODEPIPELINE_NAME }}
env:
# Maintenance: Migrate to new OAuth mechanism
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-1
AWS_DEFAULT_OUTPUT: json
- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email [email protected]
- name: Build docs website and API reference
run: |
make release-docs VERSION=${RELEASE_TAG_VERSION} ALIAS="latest"
poetry run mike set-default --push latest
- name: Release API docs to release version
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: ${{ env.RELEASE_TAG_VERSION }}/api
- name: Release API docs to latest
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: latest/api
- name: Close issues related to this release
uses: actions/github-script@v6
with:
script: |
const post_release = require('.github/workflows/post_release.js')
await post_release({github, context, core})

sync_master:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Sync master from detached head
# If version matches CHANGELOG and pyproject.toml
# If it passes all checks, successfully releases to test and prod
# Then sync up master with latest source code release
# where commit message will be Release notes title
run: git push origin HEAD:refs/heads/master --force
- uses: actions/checkout@v3
- name: Sync master from detached head
# If version matches CHANGELOG and pyproject.toml
# If it passes all checks, successfully releases to test and prod
# Then sync up master with latest source code release
# where commit message will be Release notes title
run: git push origin HEAD:refs/heads/master --force
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- develop
workflow_dispatch:

jobs:
update_release_draft:
Expand Down
Loading