Skip to content
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
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.43
4 changes: 3 additions & 1 deletion .github/actions/setup-bun/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ runs:
using: 'composite'
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version-file: '.bun-version'
23 changes: 6 additions & 17 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,18 @@ runs:
restore-keys: |
${{ runner.os }}-turbo-

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: false

- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
- name: Install NodeJS
uses: actions/setup-node@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version-file: '.node-version'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install dependencies
shell: bash
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup NodeJS
uses: ./.github/actions/setup-node

- name: Setup environment files
uses: ./.github/actions/setup-env-files
with:
storyblok-token: ${{ secrets.STAGING_STORYBLOK_TOKEN }}

- name: Setup DFX
uses: ./.github/actions/setup-dfx

- name: DFX build
run: dfx build --check
41 changes: 41 additions & 0 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Codestyle

on:
push:
branches:
- main
pull_request:

jobs:
rust_codestyle:
name: Rust codestyle
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Cargo fmt
run: cargo fmt -- --check

- name: Cargo clippy
run: cargo clippy --all-targets --all-features

typescript_codestyle:
name: TypeScript codestyle
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup NodeJS
uses: ./.github/actions/setup-node

- name: Check TypeScript formatting
run: pnpm format:check

- name: Run ESLint
run: pnpm lint
39 changes: 0 additions & 39 deletions .github/workflows/integration-test.yml

This file was deleted.

11 changes: 7 additions & 4 deletions .github/workflows/mainnet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ jobs:
name: mainnet
url: https://npiey-xiaaa-aaaal-qcx2q-cai.icp0.io
steps:
- name: Checkout Code
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: ./.github/actions/setup-node
- name: Setup NodeJS
uses: ./.github/actions/setup-node

- uses: ./.github/actions/setup-env-files
- name: Setup environment files
uses: ./.github/actions/setup-env-files
with:
storyblok-token: ${{ secrets.PRODUCTION_STORYBLOK_TOKEN }}

- uses: ./.github/actions/setup-dfx
- name: Setup DFX
uses: ./.github/actions/setup-dfx

- name: Import DFX identity
run: |
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/rust-tests.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Tests

on:
push:
branches:
- main
pull_request:

jobs:
rust_tests:
name: Rust tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Cargo test
run: cargo test

typescript_tests:
name: Typescript tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup NodeJS
uses: ./.github/actions/setup-node

- name: Install Playwright dependencies
run: pnpm run playwright-install

- name: Setup dfx
uses: ./.github/actions/setup-dfx

- name: Setup environment files
uses: ./.github/actions/setup-env-files
with:
storyblok-token: ${{ secrets.STAGING_STORYBLOK_TOKEN }}

- name: UI library tests
run: pnpm turbo test -F @cg/ui

- name: Angular UI library tests
run: pnpm turbo test -F @cg/angular-ui

- name: Frontend unit tests
run: pnpm turbo test -F frontend

backend_integration_tests:
name: Backend integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup NodeJS
uses: ./.github/actions/setup-node

- name: Setup bun
uses: ./.github/actions/setup-bun

- name: Setup dfx
uses: ./.github/actions/setup-dfx

- name: DFX build
run: dfx build backend --check

- name: Backend integration tests
run: pnpm turbo test -F backend-integration
23 changes: 0 additions & 23 deletions .github/workflows/typescript-tests.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ dist/
.turbo/
coverage/
.angular/
www/
test-results/

# environment variables
.env
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"astro-build.astro-vscode",
"angular.ng-template",
"tamasfe.even-better-toml",
"rust-lang.rust-analyzer"
"rust-lang.rust-analyzer",
"vercel.turbo-vsc"
]
}
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ Else, refer to the following sections.
| `dfx deploy docs` | Deploy to a local DFX replica |
| `pnpm turbo start -F docs` | Run a local development server |

### `@cg/ui`

| Command | Description |
| ---------------------------- | ----------------- |
| `pnpm turbo build -F @cg/ui` | Build the library |
| `pnpm turbo test -F @cg/ui` | Run unit tests |

### `@cg/ui-angular`

| Command | Description |
| ------------------------------------ | ----------------- |
| `pnpm turbo build -F @cg/ui-angular` | Build the library |
| `pnpm turbo test -F @cg/ui-angular` | Run unit tests |

### Backend

The primary backend canister for CodeGov proposal review management.
Expand Down Expand Up @@ -297,7 +311,6 @@ dfx canister call backend update_user_profile '(record { user_id = "${userId}";
Or to only upgrade a user to a reviewer:

```bash

dfx canister call backend update_user_profile '(record { user_id = "${userId}"; config = opt variant { reviewer = record {} } })'
```

Expand Down Expand Up @@ -353,6 +366,33 @@ To list open replica version management proposals:
- `payload` is the Candid encoded argument for the corresponding NNS function. The types for this argument can be found in the appropriate canister's declaration. A mapping between NNS functions and their corresponding canisters can be found in the [`NnsFunction::canister_and_function`](https://github.com/dfinity/ic/blob/master/rs/nns/governance/src/governance.rs#L527-L631) function definition.
- For example, the `UpdateElectedReplicaVersions` uses number `38` and its payload is the [`UpdateElectedReplicaVersionsPayload`](https://github.com/dfinity/ic/blob/master/rs/registry/canister/canister/registry.did#L217-L223) record.

### Getting proposals for testing

Open the [NNS canister interface on the dashboard](https://dashboard.internetcomputer.org/canister/rrkah-fqaaa-aaaaa-aaaaq-cai#list_proposals). It should open on the `list_proposals` method.

- Set `limit` to whatever you want, although lower numbers are recommended for a more manageable data set.
- Set the `exclude_topic` length to `17`
- Add the following topics to the `exclude_topic` list:
- `0` for `Unspecified`
- `1` for `NeuronManagement`
- `2` for `ExchangeRate`
- `3` for `NetworkEconomics`
- `4` for `Governance`
- `5` for `NodeAdmin`
- `6` for `ParticipantManagement`
- `7` for `SubnetManagement`
- `8` for `NetworkCanisterManagement`
- `9` for `Kyc`
- `10` for `NodeProviderRewards`
- `12` for `IcOsVersionDeployment`
- `14` for `SnsAndCommunityFund`
- `15` for `ApiBoundaryNodeManagement`
- `16` for `SubnetRental`
- `17` for `ProtocolCanisterManagement`
- `18` for `ServiceNervousSystemManagement`
- Note that `11` currently doesn't exist, and `13` is `IcOsVersionElection`, the topic we want.
- Finally, click the `Call` button to get a list of proposals.

### Manually syncing proposals

To manually trigger the proposals synchronization from the Nervous Systems, run the following command:
Expand Down
Loading
Loading