Skip to content

Fix failing "Codegen" GitHub Actions job#203

Open
pgherveou wants to merge 9 commits into
mainfrom
fix/diagnosis-report-push
Open

Fix failing "Codegen" GitHub Actions job#203
pgherveou wants to merge 9 commits into
mainfrom
fix/diagnosis-report-push

Conversation

@pgherveou
Copy link
Copy Markdown
Collaborator

@pgherveou pgherveou commented Jun 5, 2026

Feature: Fix failing "Codegen" GitHub Actions job

Summary

The "Codegen" CI job was failing because npm ci (without --ignore-scripts) caused npm to run prepare lifecycle scripts for all workspace packages during installation — before codegen had generated the required TypeScript files and before @parity/truapi's dist/ directory was built. This resulted in TypeScript compilation errors (Cannot find module '@parity/truapi') when building @parity/truapi-host.

Checklist

  • Added docs/features/short-descriptive-name.md with completed frontmatter
  • Updated docs/features/_index.md with a link to the new proposal
  • Added labels: feature-request, proposal

Use Cases

CI pipelines for the paritytech/truapi repository need to reliably build and verify the generated TypeScript client and host packages without spurious failures caused by incorrect build ordering during npm ci.

Proposed Solution

  • Made prepare scripts in both @parity/truapi and @parity/truapi-host conditional on TRUAPI_SKIP_PACKAGE_BUILD: if [ "${TRUAPI_SKIP_PACKAGE_BUILD:-0}" != "1" ]; then npm run build; fi
  • Changed all CI jobs to use TRUAPI_SKIP_PACKAGE_BUILD=1 npm ci --ignore-scripts to skip lifecycle scripts during installation
  • For jobs that need @parity/truapi built (ts-client, playground, explorer, dotli), added an explicit npm run build --prefix js/packages/truapi step after install to ensure the package is built in the correct order before dependent packages

pgherveou added 2 commits June 5, 2026 17:03
persist-credentials: false strips the token from the origin remote, so the
raw git push had no credentials and failed with 'could not read Username for
https://github.com'. Push to an explicit x-access-token URL built from
GH_TOKEN and github.repository.
actions/configure-pages calls the Pages API, but the top-level
'contents: read' permission gave the build job no pages scope, so it failed
with 'Resource not accessible by integration' on Get Pages site. Grant the
build job pages: write and id-token: write.
@pgherveou pgherveou requested a review from a team June 5, 2026 15:03
Copilot AI changed the title ci: fix diagnosis-report push auth and deploy-docs Pages permissions Fix failing "Codegen" GitHub Actions job Jun 5, 2026
@pgherveou pgherveou enabled auto-merge June 5, 2026 17:35
@pgherveou pgherveou added this pull request to the merge queue Jun 5, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 5, 2026
@filvecchiato filvecchiato added this pull request to the merge queue Jun 5, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants