Skip to content

docs: add maintainers and public roadmap #1167

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 13 commits into from
Nov 19, 2022
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug report
description: Report a reproducible bug to help us improve
title: "Bug: TITLE"
labels: ["bug", "triage"]
labels: ["type/bug", "triage"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -76,8 +76,8 @@ body:
- type: textarea
id: logs
attributes:
label: Debugging logs
description: If available, please share [debugging logs](https://awslabs.github.io/aws-lambda-powertools-python/#debug-mode)
label: Execution logs
description: If available, please share some logs making sure to remove any sensitive data
render: Shell
validations:
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation_improvements.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Documentation improvements
description: Suggest a documentation update to improve everyone's experience
title: "Docs: TITLE"
labels: ["documentation", "triage"]
labels: ["area/documentation", "triage"]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature request
description: Suggest an idea for Lambda Powertools
title: "Feature request: TITLE"
labels: ["feature-request", "triage"]
labels: ["type/feature-request", "triage"]
body:
- type: markdown
attributes:
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/maintenance.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Maintenance
description: Suggest an activity to help address tech debt, governance, and anything internal
title: "Maintenance: TITLE"
labels: ["internal", "triage"]
labels: ["type/internal", "triage"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -32,7 +32,6 @@ body:
- Automation
- Governance
- Tests
- Types
- Tracer
- Logger
- Metrics
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/rfc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Request for Comments (RFC)
description: Feature design and detailed proposals
title: "RFC: TITLE"
labels: ["RFC", "triage"]
labels: ["type/RFC", "triage"]
body:
- type: markdown
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

## Checklist

- [ ] [My changes meet the tenets criteria](https://awslabs.github.io/aws-lambda-powertools-python/#tenets)
- [ ] [My changes meet the tenets criteria](https://awslabs.github.io/aws-lambda-powertools-typescript/#tenets)
- [ ] I have performed a *self-review* of my own code
- [ ] I have *commented* my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
- [ ] I have made corresponding changes to the *documentation*
Expand All @@ -41,7 +41,7 @@
- [ ] The *code coverage* hasn't decreased
- [ ] I have *added tests* that prove my change is effective and works
- [ ] New and existing *unit tests pass* locally and in Github Actions
- [ ] Any *dependent changes have been merged and published* in downstream module
- [ ] Any *dependent changes have been merged and published*
- [ ] The PR title follows the [conventional commit semantics](https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/.github/semantic.yml#L2)

### Breaking change checklist
Expand Down
6 changes: 0 additions & 6 deletions .github/auto_assign-issues.yml

This file was deleted.

19 changes: 9 additions & 10 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@ change-template: "* $TITLE (#$NUMBER) by @$AUTHOR"
categories:
- title: '⚡ Breaking Changes'
labels:
- 'breaking-change'
- 'type/breaking-change'
- title: '🌟New features and non-breaking changes'
labels:
- 'major'
- 'feature'
- 'type/feature'
- title: '🌟 Minor Changes'
labels:
- 'enhancement'
- 'type/enhancement'
- title: '📜 Documentation updates'
labels:
- 'documentation'
- 'area/documentation'
- title: '🐛 Bug and hot fixes'
labels:
- 'bug'
- 'fix'
- 'type/bug'
- 'type/fix'
- title: '🚒 Deprecations'
labels:
- 'deprecated'
- 'type/deprecation'
- title: '🔧 Maintenance'
labels:
- 'internal'
- 'dependencies'
- 'type/internal'
- 'type/dependencies'
exclude-labels:
- 'skip-changelog'
tag-template: 'v$NEXT_PATCH_VERSION'
Expand Down
5 changes: 4 additions & 1 deletion .github/scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ module.exports = Object.freeze({
"LABEL_BLOCK_REASON": "need-issue",

/** @type {string} */
"LABEL_PENDING_RELEASE": "pending-release",
"LABEL_PENDING_RELEASE": "status/pending-release",

/** @type {string} */
"LABEL_RELEASED": "status/completed",

/** @type {string} */
"HANDLE_MAINTAINERS_TEAM": "@awslabs/aws-lambda-powertools-typescript",
Expand Down
33 changes: 9 additions & 24 deletions .github/scripts/label_pr_based_on_title.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
const { PR_NUMBER, PR_TITLE, AREAS } = require("./constants");
const { PR_NUMBER, PR_TITLE } = require("./constants");

module.exports = async ({github, context, core}) => {
const FEAT_REGEX = /feat(\((.+)\))?(:.+)/
const BUG_REGEX = /(fix|bug)(\((.+)\))?(:.+)/
const FEAT_REFACTOR_REGEX = /(feat|refactor)(\((.+)\))?(:.+)/
const DOCS_REGEX = /(docs|doc)(\((.+)\))?(:.+)/
const CHORE_REGEX = /(chore)(\((.+)\))?(:.+)/
const DEPRECATED_REGEX = /(deprecated)(\((.+)\))?(:.+)/
const REFACTOR_REGEX = /(refactor)(\((.+)\))?(:.+)/


const labels = {
"feature": FEAT_REGEX,
"bug": BUG_REGEX,
"documentation": DOCS_REGEX,
"internal": CHORE_REGEX,
"enhancement": REFACTOR_REGEX,
"deprecated": DEPRECATED_REGEX,
};
"type/feature": FEAT_REFACTOR_REGEX,
"type/bug": BUG_REGEX,
"area/documentation": DOCS_REGEX,
"type/internal": CHORE_REGEX,
"type/deprecation": DEPRECATED_REGEX,
}

// Maintenance: We should keep track of modified PRs in case their titles change
let miss = 0;
Expand All @@ -33,19 +31,6 @@ module.exports = async ({github, context, core}) => {
labels: [label]
});

const area = matches[2]; // second capture group contains the area
if (AREAS.indexOf(area) > -1) {
core.info(`Auto-labeling PR ${PR_NUMBER} with area ${area}`);
await github.rest.issues.addLabels({
issue_number: PR_NUMBER,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [`area/${area}`],
});
} else {
core.debug(`'${PR_TITLE}' didn't match any known area.`);
}

return;
} else {
core.debug(`'${PR_TITLE}' didn't match '${label}' semantic.`);
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/label_related_issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
LABEL_PENDING_RELEASE,
HANDLE_MAINTAINERS_TEAM,
PR_IS_MERGED,
} = require("./constants")
} = require("./constants");

module.exports = async ({github, context, core}) => {
if (IGNORE_AUTHORS.includes(PR_AUTHOR)) {
Expand Down
113 changes: 113 additions & 0 deletions .github/scripts/post_release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
const { LABEL_PENDING_RELEASE, LABEL_RELEASED } = require("./constants");

/**
* Fetch issues using GitHub REST API
*
* @param {object} gh_client - Pre-authenticated REST client (Octokit)
* @param {string} org - GitHub Organization
* @param {string} repository - GitHub repository
* @param {string} state - GitHub issue state (open, closed)
* @param {string} label - Comma-separated issue labels to fetch
* @return {Object[]} issues - Array of issues matching params
* @see {@link https://octokit.github.io/rest.js/v18#usage|Octokit client}
*/

const fetchIssues = async ({
gh_client,
org,
repository,
state = "all",
label = LABEL_PENDING_RELEASE,
}) => {
try {
const { data: issues } = await gh_client.rest.issues.listForRepo({
owner: org,
repo: repository,
state: state,
labels: label,
});

return issues;
} catch (error) {
console.error(error);
throw new Error("Failed to fetch issues");
}

};

/**
* Notify new release and close staged GitHub issue
*
* @param {object} gh_client - Pre-authenticated REST client (Octokit)
* @param {string} owner - GitHub Organization
* @param {string} repository - GitHub repository
* @param {string} release_version - GitHub Release version
* @see {@link https://octokit.github.io/rest.js/v18#usage|Octokit client}
*/

const notifyRelease = async ({
gh_client,
owner,
repository,
release_version,
}) => {
const release_url = `https://github.com/${owner}/${repository}/releases/tag/v${release_version}`;

const issues = await fetchIssues({
gh_client: gh_client,
org: owner,
repository: repository,
});

issues.forEach(async (issue) => {
console.info(`Updating issue number ${issue.number}`);

const comment = `This is now released under [${release_version}](${release_url}) version!`;
try {
await gh_client.rest.issues.createComment({
owner: owner,
repo: repository,
body: comment,
issue_number: issue.number,
});
} catch (error) {
console.error(error);
throw new Error(`Failed to update issue ${issue.number} about ${release_version} release`)
}


// Close issue and remove staged label; keep existing ones
const labels = issue.labels
.filter((label) => label.name != LABEL_PENDING_RELEASE)
.map((label) => label.name);

try {
await gh_client.rest.issues.update({
repo: repository,
owner: owner,
issue_number: issue.number,
state: "closed",
labels: [...labels, LABEL_RELEASED],
});
} catch (error) {
console.error(error);
throw new Error("Failed to close issue")
}

console.info(`Issue number ${issue.number} closed and updated`);
Comment on lines +80 to +97
Copy link
Contributor

Choose a reason for hiding this comment

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

(non-blocking)

While I love the automation, I'm a bit concerned if we could close the issue unexpectedly?
(e.g. an issue with multiple PR and a lot of on going work like a feature request)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can reopen those issues if needed.

The idea is that if there's a "big feature issue" like Idempotency, we should have smaller issues for each one of the work streams, and each PR should correspond to one of these issues, not the main bigger one.

What do you think about trying this out and , if it doesn't work or becomes a hassle, remove it in a few weeks?

});
};

// context: https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts

module.exports = async ({ github, context }) => {
const { RELEASE_VERSION } = process.env;
console.log(`Running post-release script for ${RELEASE_VERSION} version`);

await notifyRelease({
gh_client: github,
owner: context.repo.owner,
repository: context.repo.repo,
release_version: RELEASE_VERSION,
});
};
9 changes: 4 additions & 5 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ only: issues
daysUntilStale: 30
daysUntilClose: 7
exemptLabels:
- bug
- documentation
- enhancement
- feature-request
- RFC
- type/bug
- type/bug-upstream
- type/feature-request
- type/RFC
staleLabel: pending-close-response-required
markComment: >
This issue has been automatically marked as stale because it has not had
Expand Down
Loading