Skip to content

Commit

Permalink
Merge branch 'master' into mhofman/5542-export-state-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Mar 31, 2023
2 parents b86ae62 + f4de2ed commit c692911
Show file tree
Hide file tree
Showing 224 changed files with 2,400 additions and 1,052 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
/* eslint-disable no-restricted-syntax */
/* eslint-env node */
const process = require('process');

const lintTypes = !!process.env.AGORIC_ESLINT_TYPES;

const deprecatedTerminology = [
['currency', 'brand, asset or another descriptor'],
['loan', 'debt'],
['blacklist', 'denylist'],
['whitelist', 'allowlist'],
['RUN', 'IST', '/RUN/'],
].flatMap(([bad, good, badRgx = `/${bad}/i`]) =>
[
['Literal', 'value'],
['TemplateElement', 'value.raw'],
['Identifier', 'name'],
].map(([selectorType, field]) => ({
selector: `${selectorType}[${field}=${badRgx}]`,
message: `Use '${good}' instead of deprecated '${bad}'`,
})),
);

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -30,6 +48,7 @@ module.exports = {
// CI has a separate format check but keep this warn to maintain that "eslint --fix" prettifies
// UNTIL https://github.com/Agoric/agoric-sdk/issues/4339
'prettier/prettier': 'warn',
'no-restricted-syntax': ['warn', ...deprecatedTerminology],
},
settings: {
jsdoc: {
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/notify-status/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
body: |-
Job ${{ github.job }} in workflow ${{ github.workflow }} of ${{ github.repository }} status ${{ job.status }}
Please take discussion to @agoric#eng_coordination
Please take discussion to #ops-engineering
Details at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
# comma-separated string, send email to
Expand Down
52 changes: 52 additions & 0 deletions .github/actions/post-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Post Test Functions
description: 'Runs test uploading and coverage uploading'

inputs:
codecov-token:
description: 'token for codecov'
required: false
default: ''
datadog-token:
description: 'token for datadog'
required: false
default: ''
datadog-site:
description: 'site for datadog'
required: false
default: 'us3.datadoghq.com'

runs:
using: composite
steps:
- name: upload tests
shell: bash
if: ${{ github.repository_owner == 'agoric' }} && (success() || failure())
env:
DD_ENV: ci
DATADOG_SITE: ${{ inputs.datadog-site }}
run: |
./scripts/ci-collect-testruns.sh
if [ "${{ inputs.datadog-token }}" != "" ]; then
export DATADOG_API_KEY="${{ inputs.datadog-token }}"
export DD_ENV="ci"
export DD_SITE="${{ inputs.datadog-site }}"
npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
fi
- name: upload coverage prepare
shell: bash
id: coverage-prep
if: ${{ github.repository_owner == 'agoric' }} && (success() || failure())
run: |
if [ "${{ inputs.codecov-token }}" != "" ]; then
# delete v8 coverage jsons to reduce noise
find . -name "coverage*.json" -delete
echo "skip=false" >> $GITHUB_OUTPUT
else
echo "skip=true" >> $GITHUB_OUTPUT
fi
- name: Upload coverage reports to Codecov
if: ${{ github.repository_owner == 'agoric' }} && ${{ steps.coverage-prep.outputs.skip == 'false' }} && (success() || failure())
uses: codecov/codecov-action@v3
with:
token: ${{ inputs.codecov-token }}
41 changes: 41 additions & 0 deletions .github/workflows/cron-stale-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
schedule:
- cron: '0 8 * * *'
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}

jobs:
find_stale_prs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- shell: bash
run: |
stale_prs=$(gh pr list -R "$OWNER/$REPO" --json url,updatedAt,title,state,number,mergeable,labels,id,createdAt,author -L 1000 -s open -q '.|sort_by(.author.login)|.[]|(now - (.updatedAt|fromdate)) as $u|select(.state=="OPEN" and (.labels[].name|contains("merge")) and $u>86400)|{url:.url, author: .author.login, title: .title, updated: .updatedAt, u: $u, number: .number}' | jq -c .)
if [[ "$stale_prs" != "" ]]; then
while IFS= read -r line; do
echo "Stale PR: $line"
prNum=$(echo "$line" | jq -r .number)
prOpener=$(echo "$line" | jq -r .author)
gh pr comment -R "$OWNER/$REPO" $prNum -b "@${prOpener} - This PR appears to be stuck. It's had a merge label for > 24 hours"
done <<< "$stale_prs"
echo "detected stale PRs"
exit 1
else
echo "no stale PRs detected"
exit 0
fi
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
1 change: 1 addition & 0 deletions .github/workflows/deployment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
make install
working-directory: /usr/src/agoric-sdk
- run: /usr/src/agoric-sdk/packages/deployment/scripts/integration-test.sh
timeout-minutes: 90
working-directory: /usr/src/agoric-sdk
env:
NETWORK_NAME: chaintest
Expand Down
Loading

0 comments on commit c692911

Please sign in to comment.