Skip to content

chore(ci): merge develop to main for preview release v0.0.2-preview #183

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 33 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a518e3b
add custom exception json converter
amirkaws Aug 16, 2022
741d6c9
minor improvement
amirkaws Aug 16, 2022
da3af3b
add comments to the method variables
amirkaws Aug 16, 2022
7324009
minor changes in comments and formatting
amirkaws Aug 16, 2022
bf5d101
remove JsonIgnoreCondition.Always
amirkaws Aug 17, 2022
c2e3f72
rename variables
amirkaws Aug 17, 2022
78c4515
make ExceptionConvertor internal
amirkaws Aug 17, 2022
456abe8
apply property name policy to property name
amirkaws Aug 17, 2022
4dc1a81
handle exception extra keys
amirkaws Aug 22, 2022
c0a290f
chore(docs): add discord invitation link
sthuber90 Aug 23, 2022
b649ed2
add lambda serlialization json converters to support lambda event log…
amirkaws Aug 24, 2022
2140040
add unit tests for lambda serlialization json converters
amirkaws Aug 24, 2022
efe4a56
Merge pull request #155 from sthuber90/add-discord-link-154
sliedig Aug 25, 2022
6a2e23a
Merge pull request #152 from amirkaws/amirkaws-custom-exception-json-…
sliedig Sep 12, 2022
4cb45ea
docs: typo in metrics README
kenfdev Sep 21, 2022
321f2cc
Fix some grammar; update links to example projects.
nCubed Nov 10, 2022
155f100
Merge pull request #170 from nCubed/develop
sliedig Nov 13, 2022
810dd7f
Merge pull request #157 from kenfdev/fix-readme-title-typo
sliedig Dec 22, 2022
e9d0a6e
fix: updated logger casing env vars in samples
sliedig Dec 29, 2022
d05bbf0
chore(ci): minor updates, licensing
sliedig Dec 29, 2022
9a3229a
fix: removed duplicate template issue
sliedig Jan 1, 2023
3aaab4e
chore(docs): updated documentation (#175)
sliedig Jan 4, 2023
99704b6
Merge pull request #173 from sliedig/sliedig-samples
sliedig Jan 4, 2023
b4cb21c
chore: updated packages (#172)
sliedig Jan 4, 2023
f225e96
Merge pull request #174 from sliedig/sliedig-ci
sliedig Jan 4, 2023
5f803f8
g chore(ci): updating actions
sliedig Jan 4, 2023
84a6e95
Merge remote-tracking branch 'upstream/develop' into sliedig-ci
sliedig Jan 4, 2023
8490258
chore: updated setup-dotnet@v1 to @v3
sliedig Jan 5, 2023
6ad08c6
Merge pull request #179 from sliedig/sliedig-ci
sliedig Jan 11, 2023
8bafb25
chore(deps): bump gitpython from 3.1.29 to 3.1.30
dependabot[bot] Jan 11, 2023
c225701
Merge pull request #181 from awslabs/dependabot/pip/gitpython-3.1.30
sliedig Jan 11, 2023
eeb9420
chore(ci): bumped version
sliedig Jan 18, 2023
f854e95
Merge pull request #182 from sliedig/develop
sliedig Jan 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/awslabs/aws-lambda-powertools-dotnet/discussions/new
about: Ask a general question about Lambda Powertools
about: Ask a general question about Lambda Powertools
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/share_your_work.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: I Made This (showcase your work)
description: Share what you did with Powertools 💞💞. Blog post, workshops, presentation, sample apps, etc.
title: "[I Made This]: <TITLE>"
labels: ["community-content"]
body:
- type: markdown
attributes:
value: Thank you for helping spread the word out on Powertools, truly!
- type: input
id: content
attributes:
label: Link to your material
description: |
Please share the original link to your material.

*Note: Short links will be expanded when added to Powertools documentation*
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Describe in one paragraph what's in it for them (readers)
validations:
required: true
- type: input
id: author
attributes:
label: Preferred contact
description: What's your preferred contact? We'll list it next to this content
validations:
required: true
- type: input
id: author-social
attributes:
label: (Optional) Social Network
description: If different from preferred contact, what's your preferred contact for social interactions?
validations:
required: false
- type: textarea
id: notes
attributes:
label: (Optional) Additional notes
description: |
Any notes you might want to share with us related to this material.

*Note: These notes are explicitly to Powertools maintainers. It will not be added to the community resources page.*
validations:
required: false
- type: checkboxes
id: acknowledgment
attributes:
label: Acknowledgment
options:
- label: I understand this content may be removed from Powertools documentation if it doesn't conform with the [Code of Conduct](https://aws.github.io/code-of-conduct)
required: true
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/support_powertools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Support Lambda Powertools (become a reference)
description: Add your organization's name or logo to the Lambda Powertools documentation
title: "[Support Lambda Powertools]: <your organization name>"
labels: ["customer-reference"]
body:
- type: markdown
attributes:
value: |
Thank you for becoming a reference customer. Your support means a lot to us. It also helps new customers to know who's using it.

If you would like us to also display your organization's logo, please share a link in the `Company logo` field.
- type: input
id: organization
attributes:
label: Organization Name
description: Please share the name of your organization
placeholder: ACME
validations:
required: true
- type: input
id: name
attributes:
label: Your Name
description: Please share your name
validations:
required: true
- type: input
id: job
attributes:
label: Your current position
description: Please share your current position at your company
validations:
required: true
- type: input
id: logo
attributes:
label: (Optional) Company logo
description: Company logo you want us to display. You also allow us to resize for optimal placement in the documentation.
validations:
required: false
- type: textarea
id: use_case
attributes:
label: (Optional) Use case
description: How are you using Lambda Powertools today? *features, etc.*
validations:
required: false
- type: checkboxes
id: other_languages
attributes:
label: Also using other Lambda Powertools languages?
options:
- label: Python
required: false
- label: Java
required: false
- label: TypeScript
required: false
- type: markdown
attributes:
value: |
*By raising a Support Lambda Powertools issue, you are granting AWS permission to use your company's name (and/or logo) for the limited purpose described here. You are also confirming that you have authority to grant such permission.*

*You can opt-out at any time by commenting or reopening this issue.*
73 changes: 73 additions & 0 deletions .github/scripts/comment_on_large_pr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
const {
PR_NUMBER,
PR_ACTION,
PR_AUTHOR,
IGNORE_AUTHORS,
} = require("./constants")


/**
* Notify PR author to split XXL PR in smaller chunks
*
* @param {object} core - core functions instance from @actions/core
* @param {object} gh_client - Pre-authenticated REST client (Octokit)
* @param {string} owner - GitHub Organization
* @param {string} repository - GitHub repository
*/
const notifyAuthor = async ({
core,
gh_client,
owner,
repository,
}) => {
core.info(`Commenting on PR ${PR_NUMBER}`)

let msg = `### ⚠️Large PR detected⚠️

Please consider breaking into smaller PRs to avoid significant review delays. Ignore if this PR has naturally grown to this size after reviews.
`;

try {
await gh_client.rest.issues.createComment({
owner: owner,
repo: repository,
body: msg,
issue_number: PR_NUMBER,
});
} catch (error) {
core.setFailed("Failed to notify PR author to split large PR");
console.error(err);
}
}

module.exports = async ({github, context, core}) => {
if (IGNORE_AUTHORS.includes(PR_AUTHOR)) {
return core.notice("Author in IGNORE_AUTHORS list; skipping...")
}

if (PR_ACTION != "labeled") {
return core.notice("Only run on PRs labeling actions; skipping")
}


/** @type {string[]} */
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: PR_NUMBER,
})

// Schema: https://docs.github.com/en/rest/issues/labels#list-labels-for-an-issue
for (const label of labels) {
core.info(`Label: ${label}`)
if (label.name == "size/XXL") {
await notifyAuthor({
core: core,
gh_client: github,
owner: context.repo.owner,
repository: context.repo.repo,
})
break;
}
}
}
40 changes: 40 additions & 0 deletions .github/scripts/enforce_acknowledgment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const {
PR_ACTION,
PR_AUTHOR,
PR_BODY,
PR_NUMBER,
IGNORE_AUTHORS,
LABEL_BLOCK,
LABEL_BLOCK_REASON
} = require("./constants")

module.exports = async ({github, context, core}) => {
if (IGNORE_AUTHORS.includes(PR_AUTHOR)) {
return core.notice("Author in IGNORE_AUTHORS list; skipping...")
}

if (PR_ACTION != "opened") {
return core.notice("Only newly open PRs are labelled to avoid spam; skipping")
}

const RELATED_ISSUE_REGEX = /Issue number:[^\d\r\n]+(?<issue>\d+)/;
const isMatch = RELATED_ISSUE_REGEX.exec(PR_BODY);
if (isMatch == null) {
core.info(`No related issue found, maybe the author didn't use the template but there is one.`)

let msg = "No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.";
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
body: msg,
issue_number: PR_NUMBER,
});

return await github.rest.issues.addLabels({
issue_number: PR_NUMBER,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [LABEL_BLOCK, LABEL_BLOCK_REASON]
})
}
}
15 changes: 1 addition & 14 deletions .github/scripts/label_pr_based_on_title.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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(\((.+)\))?(:.+)/
Expand Down Expand Up @@ -33,19 +33,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
12 changes: 1 addition & 11 deletions .github/scripts/label_related_issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = async ({github, context, core}) => {

try {
core.info(`Auto-labeling related issue ${issue} for release`)
await github.rest.issues.addLabels({
return await github.rest.issues.addLabels({
issue_number: issue,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -50,14 +50,4 @@ module.exports = async ({github, context, core}) => {
core.setFailed(`Is this issue number (${issue}) valid? Perhaps a discussion?`);
throw new Error(error);
}

const { groups: {relatedIssueNumber} } = isMatch

core.info(`Auto-labeling related issue ${relatedIssueNumber} for release`)
return await github.rest.issues.addLabels({
issue_number: relatedIssueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [relatedIssueNumber]
})
}
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.302
- name: Install solution dependencies
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Standalone workflow to update changelog if necessary
name: Build changelog

on:
workflow_dispatch:

jobs:
changelog:
uses: ./.github/workflows/reusable_publish_changelog.yml
38 changes: 38 additions & 0 deletions .github/workflows/on_label_added.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: On Label added

on:
workflow_run:
workflows: ["Record PR details"]
types:
- completed

jobs:
get_pr_details:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

split-large-pr:
needs: get_pr_details
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
# Maintenance: Persist state per PR as an artifact to avoid spam on label add
- name: "Suggest split large Pull Request"
uses: actions/github-script@v6
env:
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
PR_ACTION: ${{ needs.get_pr_details.outputs.prAction }}
PR_AUTHOR: ${{ needs.get_pr_details.outputs.prAuthor }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('.github/scripts/comment_on_large_pr.js');
await script({github, context, core});
2 changes: 0 additions & 2 deletions .github/workflows/on_opened_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Debug workflow_run event"
run: echo "${{ github }}"
- name: "Ensure related issue is present"
uses: actions/github-script@v6
env:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/on_push_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docs

on:
push:
branches:
- develop
paths:
- "docs/**"
- "mkdocs.yml"
- "examples/**"

jobs:
changelog:
permissions:
contents: write
uses: ./.github/workflows/reusable_publish_changelog.yml

release-docs:
needs: changelog
permissions:
contents: write
pages: write
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: develop
alias: stage
# Maintenance: Only necessary in repo migration
# - name: Create redirect from old docs
# run: |
# git checkout gh-pages
# test -f 404.html && echo "Redirect already set" && exit 0
# git checkout develop -- 404.html
# git add 404.html
# git commit -m "chore: set docs redirect" --no-verify
# git push origin gh-pages -f
Loading