-
Notifications
You must be signed in to change notification settings - Fork 23
feat: use pinned aria-at commit with cron to update #1510
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
Open
stalgiag
wants to merge
25
commits into
w3c:development
Choose a base branch
from
stalgiag:development
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fefca9c
pinned aria-at version
stalgiag 42c820c
Merge pull request #1 from stalgiag/pinned-aria-at
stalgiag 94a8090
update pinned version
stalgiag 60237b5
Merge pull request #2 from stalgiag/pinned-aria-at
stalgiag 3c1445a
Experiment with older commit
stalgiag ef2941b
ignore snapshots on initial test
stalgiag 866e3a1
Update workflow to better match test workflow
stalgiag 68c6b0b
more explicit commit SHA for latest
stalgiag 0bf05be
Use arg for latest commit
stalgiag 1a100bc
Ensure config vars are available
stalgiag 89db4f2
chore: bump ARIA-AT pin to 84bd6c8806b51557ff50c8574533a99810d8a5a8
github-actions[bot] db9a95b
Clean up docs
stalgiag e377c78
prevent README lint
stalgiag c2992cf
Merge branch 'w3c:development' into development
stalgiag 0e7f46f
chore: bump ARIA-AT pin to 2c938a8f7b4cadcffa3c17e6b253473b0dc791f8
github-actions[bot] 4c5ca20
Merge branch 'development' into personal-fork-dev
stalgiag 5c44b6e
Use latest commit in deploy cron jobs
stalgiag 8ed5214
chore: bump ARIA-AT pin to 195ff103c49712cd7baf0aa2333d4bc0cd3b5621
github-actions[bot] c58bc11
chore: bump ARIA-AT pin to 7170ce1c91efa1e3ca3be69b1fb02e097452758f
github-actions[bot] 9b887e7
chore: bump ARIA-AT pin to 3490ef81735d3cd2e56b41a705655a562e02b45f
github-actions[bot] 1a76b82
chore: bump ARIA-AT pin to e532036964a23d93ed446b09b69dcdf5de731da3
github-actions[bot] 2ec615c
chore: bump ARIA-AT pin to d46530513542e7d984df9c54df5af4b747b984ea
github-actions[bot] 9adcef9
chore: bump ARIA-AT pin to 3dda0d1af9d2f9c8592c6155836fe52f3c615bf4
github-actions[bot] 6c3c7da
chore: bump ARIA-AT pin to 5b831a682a2bd070ab3331272b6b34e7e4c76484
github-actions[bot] eb44c35
chore: bump ARIA-AT pin to fb175e0c7a6472946ea4e75d4ce42fe4f7f42ffd
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,152 @@ | ||
| name: Update pinned ARIA-AT data | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 6 * * *' | ||
| workflow_dispatch: {} | ||
|
|
||
| concurrency: | ||
| group: update-aria-at | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| bump: | ||
| name: Test latest upstream and update pin if clean | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@v4 | ||
| - name: Install NodeJS 20 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - run: yarn --version | ||
| - name: Remove pre-bundled versions of postgres to avoid version clashes | ||
| run: | | ||
| sudo DEBIAN_FRONTEND=noninteractive apt-get purge -y postgresql\* | ||
| sudo apt-get autoremove -y | ||
| sudo rm -rf /var/lib/postgresql/ | ||
| sudo rm -rf /etc/postgresql/ | ||
| - name: Install PostgreSQL 12 | ||
| run: | | ||
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | ||
| sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
| sudo apt-get -y update | ||
| sudo apt-get -y install postgresql-12 | ||
| sudo apt-get -y install postgresql-client-12 | ||
| - name: before_install | ||
| run: | | ||
| sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf | ||
| sudo pg_ctlcluster 12 main restart | ||
| - name: before_script | ||
| run: | | ||
| yarn --frozen-lockfile | ||
| npx patch-package | ||
| source config/test.env | ||
| sudo -u postgres createdb ${PGDATABASE} | ||
| echo Created ${PGDATABASE} | ||
| sudo -u postgres psql -c "CREATE ROLE ${PGUSER} WITH LOGIN PASSWORD '${PGPASSWORD}'" | ||
| sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE ${PGDATABASE} to ${PGUSER};" | ||
| yarn sequelize:test db:migrate | ||
| yarn sequelize:test db:seed:all | ||
|
|
||
| - name: Check for latest upstream SHA | ||
| id: latest | ||
| run: | | ||
| set -e | ||
| echo "Checking for latest ARIA-AT upstream SHA..." | ||
| LATEST=$(git ls-remote https://github.com/w3c/aria-at HEAD | cut -f1) | ||
| PINNED=$(cat config/aria-at.version || true) | ||
| echo "latest=$LATEST" >> $GITHUB_OUTPUT | ||
| echo "pinned=$PINNED" >> $GITHUB_OUTPUT | ||
|
|
||
| if [ -z "$LATEST" ]; then | ||
| echo "Failed to resolve latest upstream SHA" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Current pinned SHA: ${PINNED:-none}" | ||
| echo "Latest upstream SHA: $LATEST" | ||
|
|
||
| if [ "$LATEST" = "$PINNED" ]; then | ||
| echo "Already up to date with latest upstream SHA" | ||
| exit 0 | ||
| else | ||
| echo "Found newer upstream SHA, will test and update" | ||
| fi | ||
|
|
||
| - name: Import and test latest upstream SHA | ||
| if: steps.latest.outputs.latest != steps.latest.outputs.pinned | ||
| run: | | ||
| # Ensure IMPORT_ARIA_AT_TESTS_COMMIT_* env vars are available in this step | ||
| source config/test.env | ||
| echo "Importing historical commits for testing..." | ||
| yarn workspace server db-import-tests:test -c "${IMPORT_ARIA_AT_TESTS_COMMIT_1} ${IMPORT_ARIA_AT_TESTS_COMMIT_2} ${IMPORT_ARIA_AT_TESTS_COMMIT_3} ${IMPORT_ARIA_AT_TESTS_COMMIT_4}" | ||
|
|
||
| echo "Importing latest upstream commit: ${{ steps.latest.outputs.latest }}" | ||
| yarn workspace server db-import-tests:test -c "${{ steps.latest.outputs.latest }}" | ||
|
|
||
| echo "Populating sample data..." | ||
| yarn workspace server db-populate-sample-data:test | ||
|
|
||
| - name: Run tests (excluding snapshots) | ||
| if: steps.latest.outputs.latest != steps.latest.outputs.pinned | ||
| run: | | ||
| yarn workspace shared prettier | ||
| yarn workspace client prettier | ||
| yarn workspace server prettier | ||
| yarn workspace shared lint | ||
| yarn workspace client lint | ||
| yarn workspace server lint | ||
| yarn workspace shared jest | ||
| yarn workspace client jest --testPathIgnorePatterns=snapshots | ||
| yarn workspace server jest | ||
|
|
||
| - name: Update pinned SHA and snapshots (tests passed) | ||
| if: steps.latest.outputs.latest != steps.latest.outputs.pinned | ||
| run: | | ||
| echo "All tests passed! Updating pinned SHA to latest upstream..." | ||
| echo "${{ steps.latest.outputs.latest }}" > config/aria-at.version | ||
| echo "Updating snapshots..." | ||
| yarn update-snapshots | ||
|
|
||
| - name: Stage allowed files only | ||
| if: steps.latest.outputs.latest != steps.latest.outputs.pinned | ||
| run: | | ||
| set -e | ||
| git reset | ||
| git add config/aria-at.version || true | ||
| git add client/tests/e2e/snapshots || true | ||
| echo "Staged files:" | ||
| git diff --cached --name-only | ||
|
|
||
| - name: Validate staged files scope | ||
| if: steps.latest.outputs.latest != steps.latest.outputs.pinned | ||
| run: | | ||
| set -e | ||
| CHANGED=$(git diff --cached --name-only) | ||
| if [ -z "$CHANGED" ]; then echo "No changes to commit"; exit 0; fi | ||
| echo "$CHANGED" | awk '{print}' | while read -r f; do | ||
| case "$f" in | ||
| config/aria-at.version) ;; | ||
| client/tests/e2e/snapshots/*|client/tests/e2e/snapshots/*/*) ;; | ||
| *) echo "Disallowed staged change: $f"; exit 1 ;; | ||
| esac | ||
| done | ||
|
|
||
| - name: Commit updated ARIA-AT pin and snapshots | ||
| if: steps.latest.outputs.latest != steps.latest.outputs.pinned | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| set -e | ||
| echo "Committing updated ARIA-AT pin and snapshots..." | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git commit -m "chore: bump ARIA-AT pin to ${{ steps.latest.outputs.latest }}" | ||
| echo "Pushing to development branch..." | ||
| git push origin HEAD:development | ||
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| 7170ce1c91efa1e3ca3be69b1fb02e097452758f |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry that this daily interval is too big given how often the deployed environment actually checks (and may update). Right now that's every 15mins. Could we match that?