Skip to content
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

feat: Add workflow to update the aggregator #3738

Merged
merged 6 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
70 changes: 70 additions & 0 deletions .github/workflows/update-aggregator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# A GitHub Actions workflow that regularly updates the aggregator SNS parsing code
# and creates a PR for any changes.
name: Update aggregator candid bindings
on:
schedule:
- cron: '30 3 * * *'
workflow_dispatch:
push:
branches:
# Run when the development branch for this workflow is updated.
- update-aggregator
jobs:
update-aggregator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install didc
run: |
USER_BIN="$HOME/.local/bin"
mkdir -p "$USER_BIN"
echo "$USER_BIN" >> $GITHUB_PATH
version="$(jq -r .defaults.build.config.DIDC_VERSION dfx.json)"
# TODO: Make `didc` support `binstall`, then use `binstall` here.
curl -Lf "https://github.com/dfinity/candid/releases/download/${version}/didc-linux64" | install -m 755 /dev/stdin "$USER_BIN/didc"
- name: Update to the latest declared APIs
id: update
run: scripts/mk_nns_types.sh
- name: Create Pull Request
id: cpr
# Note: If there were no changes, this step creates no PR.
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GIX_BOT_PAT }}
commit-message: Update aggregator
committer: GitHub <noreply@github.com>
author: gix-bot <gix-bot@users.noreply.github.com>
base: main
# Note: Please be careful when updating the add-paths field. We have had the snsdemo committed by accident, with a pattern that matches nothing seemingly committing everything.
add-paths: rs/sns_aggregator/src/types/*
branch: bot-aggregator-update
branch-suffix: timestamp
delete-branch: true
title: 'Update aggregator'
body: |
# Motivation
We would like to parse all the latest SNS data.

# Changes
* Updated the Rust code derived from `.did` files in the aggregator.
* Note: The candid files under `declarations/nns-$CANISTER` are used as inputs.

# Tests
- [ ] Please check the API updates for any breaking changes that affect our code.
- name: Report on the action
# Since the this is a scheduled job, a failure won't be shown on any
# PR status. To notify the team, we send a message to our Slack channel on failure.
run: |
(
echo "## Aggregator Update"
if test -n "${{ steps.cpr.outputs.pull-request-number }}"
then echo "Created [PR #${{ steps.cpr.outputs.pull-request-number }}](${{ steps.cpr.outputs.pull-request-url }}) with aggregator updates."
else echo "No changes needed."
fi
) | tee -a $GITHUB_STEP_SUMMARY
- name: Notify Slack on failure
uses: dfinity/internet-identity/.github/actions/slack@release-2023-08-28
if: ${{ failure() }}
with:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: "Aggregator update failed"
1 change: 1 addition & 0 deletions CHANGELOG-Nns-Dapp-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ proposal is successful, the changes it released will be moved from this file to

#### Added

* Add a workflow to update the SNS aggregator bindings regularly.
* Added support for global network config.
* Cron job to update proposal types.
* Enable dependabot for Rust updates.
Expand Down