-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mrgrain/chore/upgrade-pacmak-and-other-jsii
- Loading branch information
Showing
22 changed files
with
1,688 additions
and
55 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: PR Prioritization | ||
on: | ||
pull_request_target: | ||
types: | ||
- labeled | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
jobs: | ||
prioritize: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Add PR to Project & Set Priority | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} | ||
script: | | ||
const script = require('./scripts/prioritization/assign-priority.js') | ||
await script({github, context}) |
19 changes: 19 additions & 0 deletions
19
.github/workflows/project-prioritization-r2-assignment.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: PR Prioritization R2 Check | ||
on: | ||
schedule: | ||
- cron: '0 */6 * * 1-5' # Runs every 6 hours during weekdays | ||
workflow_dispatch: # Manual trigger | ||
|
||
jobs: | ||
update_project_status: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check and assign R2 Priority to PRs | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} | ||
script: | | ||
const script = require('./scripts/prioritization/assign-r2-priority.js') | ||
await script({github}) |
18 changes: 18 additions & 0 deletions
18
.github/workflows/project-prioritization-r5-assignment.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: PR Prioritization R5 Check | ||
on: | ||
schedule: | ||
- cron: '0 6 * * 1-5' # Runs at 6AM every day during weekdays | ||
workflow_dispatch: # Manual trigger | ||
|
||
jobs: | ||
update_project_status: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check and Assign R5 Priority to PRs | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} | ||
script: | | ||
const script = require('./scripts/prioritization/assign-r5-priority.js') | ||
await script({github}) |
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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import { Construct } from 'constructs'; | ||
import { QueueProps } from './index'; | ||
import { Token } from '../../core'; | ||
import { ValidationError } from '../../core/lib/errors'; | ||
|
||
export function validateProps(props: QueueProps) { | ||
validateRange('delivery delay', props.deliveryDelay && props.deliveryDelay.toSeconds(), 0, 900, 'seconds'); | ||
validateRange('maximum message size', props.maxMessageSizeBytes, 1_024, 262_144, 'bytes'); | ||
validateRange('message retention period', props.retentionPeriod && props.retentionPeriod.toSeconds(), 60, 1_209_600, 'seconds'); | ||
validateRange('receive wait time', props.receiveMessageWaitTime && props.receiveMessageWaitTime.toSeconds(), 0, 20, 'seconds'); | ||
validateRange('visibility timeout', props.visibilityTimeout && props.visibilityTimeout.toSeconds(), 0, 43_200, 'seconds'); | ||
validateRange('dead letter target maximum receive count', props.deadLetterQueue && props.deadLetterQueue.maxReceiveCount, 1, +Infinity); | ||
export function validateProps(scope: Construct, props: QueueProps) { | ||
validateRange(scope, 'delivery delay', props.deliveryDelay && props.deliveryDelay.toSeconds(), 0, 900, 'seconds'); | ||
validateRange(scope, 'maximum message size', props.maxMessageSizeBytes, 1_024, 262_144, 'bytes'); | ||
validateRange(scope, 'message retention period', props.retentionPeriod && props.retentionPeriod.toSeconds(), 60, 1_209_600, 'seconds'); | ||
validateRange(scope, 'receive wait time', props.receiveMessageWaitTime && props.receiveMessageWaitTime.toSeconds(), 0, 20, 'seconds'); | ||
validateRange(scope, 'visibility timeout', props.visibilityTimeout && props.visibilityTimeout.toSeconds(), 0, 43_200, 'seconds'); | ||
validateRange(scope, 'dead letter target maximum receive count', props.deadLetterQueue && props.deadLetterQueue.maxReceiveCount, 1, +Infinity); | ||
} | ||
|
||
function validateRange(label: string, value: number | undefined, minValue: number, maxValue: number, unit?: string) { | ||
function validateRange(scope: Construct, label: string, value: number | undefined, minValue: number, maxValue: number, unit?: string) { | ||
if (value === undefined || Token.isUnresolved(value)) { return; } | ||
const unitSuffix = unit ? ` ${unit}` : ''; | ||
if (value < minValue) { throw new Error(`${label} must be ${minValue}${unitSuffix} or more, but ${value} was provided`); } | ||
if (value > maxValue) { throw new Error(`${label} must be ${maxValue}${unitSuffix} or less, but ${value} was provided`); } | ||
if (value < minValue) { throw new ValidationError(`${label} must be ${minValue}${unitSuffix} or more, but ${value} was provided`, scope); } | ||
if (value > maxValue) { throw new ValidationError(`${label} must be ${maxValue}${unitSuffix} or less, but ${value} was provided`, scope); } | ||
} |
Oops, something went wrong.