Skip to content

Package spec checks (warnings) - #482

Merged
3alpha merged 5 commits into
masterfrom
3alpha/package-spec
Nov 9, 2026
Merged

3alpha merged 5 commits into
masterfrom
3alpha/package-spec

Conversation

@3alpha

@3alpha 3alpha commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Stacked on #481; review after it. Once #481 is merged this PR targets master.

Summary

Adds a stricter package spec, and checks every package against it during build and publish. In this release violations are warnings only: nothing that builds today stops building. The plan is to turn them into errors later.

The spec is in doc/package-spec.md. For each rule it gives why it exists, which repositories break it today, and the rollout. It also lists the tropibot code each rule will make removable.

Rules

24 rules with stable ids:

Group Rules
Manifest (M01–M09) One dappnode_package.json per directory; package name format; upstream[] instead of legacy upstreamRepo/Version/Arg; the upstream arg exists in compose build.args and its value equals the upstream version; variant upstream[] keeps the root's positions; only schema fields; repository.url is the package's own repository; exposable services exist in the compose
Templates (T01–T05) No name/version on a template root; variants only in package_variants/; variant directory names; a single release file in the root or the variant, not both; every variant directory has a manifest
Compose (C01–C05) docker-compose.yml only (a custom --compose_file_name yields a release DAPPMANAGER cannot install); no container_name outside core packages; pinned external images; no ${VAR} interpolation; build.args as a mapping
Release files (F01–F03) Recognised file names (lookalikes such as notifications.yml are silently dropped today); size limits; values already of the schema type
Build inputs (B01–B02) No --skip_compose_validation; no UPSTREAM_VERSION environment override

Behaviour

  • Output: findings are printed once after the run, with rule id, file (relative to the repo root), fix and a link to the spec. The "Validate files" step title shows the count.
  • GitHub Actions: each finding is also a ::warning annotation on the run and the PR.
  • Strict mode: DAPPNODE_SDK_SPEC=error (opt-in) makes validation fail on any violation, so workflows can try strict mode before it is the default. DAPPNODE_SDK_SPEC=off skips the checks.
  • No duplicates: each finding is attributed to the file that defines the value, so a root value inherited by every variant is reported once.
  • Schema coercions (for example isBanner: "false") are reported as SPEC-F03, replacing the long "Validate files" title from Quality fixes for build, publish and GitHub actions #481.
  • The build-result comment marker is unchanged. tropibot parses its JSON with deny_unknown_fields, so findings deliberately stay out of it.

Verification

  • The checks were run over all 113 non-archived DAppNodePackage*/DNP_* repositories:
    • 58 of 87 active repositories get at least one warning, mostly SPEC-M03 (legacy upstream fields, 44 active repositories); 37 repositories are already clean.
    • The document lists the affected repositories per rule.
    • These false positives were found and fixed: digest-pinned build args (1.0.0@sha256:…), shorter variant upstream[] lists, valid avatars named like other release files, and container_name on core packages, which the installer relies on.
  • Packages created by dappnodesdk init (single and template) produce no findings.
  • yarn lint, yarn build and yarn test pass (160 passing, 1 pending). The new tests cover each rule, the no-false-positive cases, annotation escaping, and warn, error and off modes.

Build and publish now check every package against stricter package rules with stable ids (SPEC-M01 … SPEC-B02): one dappnode_package.json, upstream[] with an arg and version that match the compose build args, no named template root, only package_variants/, docker-compose.yml, no container_name outside core packages, pinned external images, no ${VAR} interpolation, mapping-style build.args, recognised release file names and size limits, and no compose-validation skip or UPSTREAM_VERSION override.

- Findings are printed once after the run with rule id, file and fix, and in GitHub Actions also as ::warning annotations. Builds never fail because of them.
- Schema coercions are reported as SPEC-F03 instead of in the step title.
- DAPPNODE_SDK_SPEC=error makes validation fail on any violation (opt-in strict mode); DAPPNODE_SDK_SPEC=off skips the checks.
- Findings are attributed to the file that defines the value, so a root value inherited by every variant is reported once.
- Run over all 113 non-archived package repos without false positives found: digest-pinned args, shorter variant upstream lists, valid avatars and core packages' container_name are accepted. Packages created by init produce no findings.
doc/package-spec.md defines the rules the SDK now checks, why each exists, which repositories break each today, the rollout from warnings to errors, rules proposed for a later phase, consumer contradictions found, and the tropibot code each rule makes removable. Warnings link to this document.
@3alpha
3alpha requested a review from a team as a code owner November 9, 2026 10:46
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 2e53a24

This is a development version and should only be installed for testing purposes.

  1. Package dappnodesdk.public.dappnode.eth

Install link

Hash: /ipfs/QmQKTvDwScYokTRAqGuVFigYvicaCdoRQxCoX4FK9pRSxJ

(by dappnodebot/build-action)

After exempting core packages from SPEC-C02, 58 (not 65) active repositories have findings.
Base automatically changed from 3alpha/quality-fixes to master November 9, 2026 11:19
This was referenced Nov 9, 2026
fix: ignore escaped compose variables (SPEC-C04)
@3alpha
3alpha merged commit 15bd089 into master Nov 9, 2026
13 checks passed
@3alpha
3alpha deleted the 3alpha/package-spec branch November 9, 2026 12:46
@3alpha 3alpha mentioned this pull request Nov 10, 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.

1 participant