shorebird_ci 0.2.8
shorebird_ci: ^0.2.8 copied to clipboard
CI tooling for Dart and Flutter monorepos. Generates GitHub Actions workflows, resolves affected packages via dependency graphs, and verifies path filters stay in sync.
0.2.8 #
- Generated workflows now declare least-privilege
permissions:, so regenerating no longer drops them from a repo that added them by hand, and a repo whose defaultGITHUB_TOKENcan write doesn't hand that topub getand test steps. The dynamic workflow and the static main and reusable workflows setcontents: readat the top level. The staticchangesjob addspull-requests: read, whichdorny/paths-filterneeds to list a pull request's files. A step you add to a generated workflow that needs more must be granted it on its job and, in a reusable workflow, on the job calling it too.
0.2.7 #
- Generated workflows no longer use
felangel/setup-bloc-toolsorstreetsidesoftware/cspell-action. Bloc lint installsbloc_tools0.1.0-dev.25 withdart pub global activate, and thecspelljob runsnpx cspell@10.4.0, each at the version that generated the workflow (their own dependencies still resolve fresh on each run). Thecspelljob runs with a read-only token that checkout doesn't persist. Flutter jobs with bloc lint now rundart formaton Flutter's own Dart:setup-bloc-toolsalso randart-lang/setup-dart@v1on a tag inside it, which a SHA pin on the outer action doesn't cover.
0.2.6 #
-
New
check_coveragecommand: fails when line coverage in lcov tracefiles is below--min(default 100), leaving out sources matching--excludeglobs. Several tracefiles are merged by summing hits per line, as test shards need. It replacesVeryGoodOpenSource/very_good_coverage, whose repository is archived, with the same rule: lines hit over lines found, and an empty or missing tracefile fails. -
generatepins every action to a commit SHA, with its release tag in a trailing comment (actions/checkout@<sha> # v7.0.1), the form GitHub's hardening guide recommends and Dependabot keeps updating. Before, generated workflows used major tags (@v6), which whoever controls the action's repo can move to new code that then runs with the job's token and secrets.--no-update-actionswrites the pins built into this version of shorebird_ci; otherwisegeneratepins each action's latest release. -
update_actionspinsowner/repo@vNrefs to the action's latest release by SHA, and movesowner/repo@<sha> # vN.N.Npins to a newer release when there is one. It doesn't follow a tag that was moved under the same version, never moves a pin to an older release, and leaves SHA pins without a version comment alone. Breaking for library users:LatestMajorResolveris nowLatestReleaseResolver, returning anActionRelease(tag and SHA), and theresolveLatestMajor:parameters areresolveLatestRelease:. -
verifyfails when the workflow pins a shorebird_ci other than the one running, naming both and theactivateline that would match it. Before,verifyoffPATHwas whatever had been globally activated, while CI activated the pinned version, so a local pass was not a CI pass: an olderverifyskipped the static-filter check 0.2.5 added and passed on a repo CI then failed. A workflow naming no exact version, a constraint among them, is reported on stdout rather than failed, since what CI resolves it to is not knowable locally. -
generatepinsdart pub global activate shorebird_cito the version that generated the workflow. Before, generated workflows activated whatever shorebird_ci was newest, so each release changed every user's CI the moment it was published, and a newverifycheck could fail a merge queue that hadn't changed. To move to a new shorebird_ci, rungenerateagain (or bump the version in the workflow). -
generateadds aconcurrencyblock to the main workflow, so a new push to a pull request cancels that PR's run still going on the older head. The group is the PR number, withgithub.run_idas the fallback, so push-to-main and merge-queue runs each get their own group and are never cancelled or queued. Therequiredaggregator now runs on!cancelled()instead ofalways(), so a cancelled superseded run shows as cancelled rather than reportingrequiredred on the old commit.
0.2.5 #
- The dependency graph behind
generate's static filters andverify's suggestions now follows Dart workspace members referenced by name alone. In a workspace,foo: ^1.0.0resolves to the member namedfoo, but onlypath:dependencies were followed, so a package's filter left out such a member and a change to it skipped the package's job. - Workspace members now depend on their workspace root's
pubspec.yamlandpubspec.lock. A member has no lockfile of its own, so a dependency bump changes only the root's lockfile, and that ran no package jobs.generateadds both files to each member's static filter,verifyexpects them there, andaffected_packagescounts a change to either as affecting every member. verifynow checks every static filter named for a package against that package's dependencies, in each workflow on its own, and fails listing the<dir>/**lines to add. Before, it only checked that the filter existed, so theRun shorebird_ci verify to check for dep graph driftline in generated workflows promised a check that never ran.generateemits bloc lint only for repos that use it. Thehas_bloc_lintinput, thefelangel/setup-bloc-toolsstep and thebloc lintstep now appear only in the workflows (dynamic job or static reusable) whose SDK has a package with abloc_lintdev dependency, and the static main workflow passeshas_bloc_lint: trueonly to those packages. Repos without bloc no longer depend on a third-party action they never run.verifyfails on a dynamic workflow that never runsbloc lintwhile some package has abloc_lintdev dependency, so a package that adopts bloc_lint aftergenerateran is caught in thesetupjob rather than silently skipping lint.- Generated workflows now trigger on
merge_group, in both--style staticand--style dynamic. Without it, a repo that turns on GitHub's merge queue produces no check runs on the queue's temp branch, therequiredcontext never reports, and the queue ejects every PR at the timeout. - Static action pin bumped to
dorny/paths-filter@v4. v3 has nomerge_groupcase and falls back to diffing the default branch by merge-base rather than the queue's base commit. Merge-queue support landed in v4.0.1. Only reachable via--no-update-actions, sincegenerateresolves pins at write time by default.
0.2.4 #
verifynow enforces the--requiredaggregator'sneeds:list. Name-based detection: if a workflow has a top-level job namedrequired, every other top-level job must appear in itsneeds:, and every entry inneeds:must match a real top-level job in the same file. Arequired:key w/ no map body is also reported as malformed. Closes three silent-failure modes: a hand-edited workflow could leave a job out ofrequired.needsand have its status silently ignored by the merge gate, a typo'dneeds:entry could go unnoticed until GHA rejected it at runtime, or a bodilessrequired:could pass verify while doing nothing at runtime.generate --requiredreserves therequiredjob name and refuses to generate when a package slug would collide. Prevents a duplicate YAML key from silently overwriting the aggregator job. Only fires for--style static(dynamic mode keys jobs bysetup/dart_ci/flutter_ci/cspell, so a package namedrequiredcan't collide there). Skip the flag and any package slug is fine.- Bad CLI args now print a usage message and exit 64 instead of dumping a Dart stack trace. Same as the convention used by other args-based tools.
verifycommand description and--requiredflag help text updated to cover the new aggregator-consistency checks and the reserved-name contract.--requiredhelp also rewraps cleanly at the col-30 boundary.
0.2.3 #
- New
--requiredflag ongenerate. When set, the generated workflow gets an aggregatorrequiredjob that depends on every other job and usesif: ${{ always() }}so it runs even when sub-jobs are skipped. The job fails only if any dependency reportsfailureorcancelled, so it's safe to use as the single required check in branch protection: per-package jobs that get skipped because no paths-filter output matched are treated as a pass. Wired into both--style staticand--style dynamic. Skipped by default, so existing generated workflows are unaffected.
0.2.2 #
- Generated Dart workflows now emit
dart analyze --fatal-warnings .explicitly. The SDK already defaults--fatal-warningsto on, so this is behavior-preserving today, but the explicit form documents intent and survives any future flip in the SDK default. Flutter workflows are unchanged:flutter analyzedefaults--fatal-warningsto on with no CLI flag. - New
--codecov-token-secret <NAME>option ongenerate. When set, the static orchestrator emitssecrets: inheriton each reusable workflow call, and the codecov-action step in the reusable workflows receivestoken: ${{ secrets.<NAME> }}. The dynamic style threads the sametoken:into its single codecov-action step. When unset (the default), no token plumbing is emitted, matching prior behavior. Private repos that need a token to upload coverage should pass--codecov-token-secret CODECOV_TOKEN(or the secret name of their choice).
0.2.1 #
- Static main workflow YAML map keys default to each package's
name:and fall back to<parent_dir>_<package_name>only when two or more packages share a name. Avoids prefixing in the common case while still handling duplicate-name:repos. Thepackage_name:input passed to the reusable workflow keeps the actual package name for codecov flag display. - Static reusable workflows now gate the test and codecov-upload steps on a new
has_unit_testsinput. Packages without atest/directory no longer attempt to rundart test/flutter testor upload coverage. The input defaults totruefor back-compat with workflows that don't pass it.
0.2.0 #
- Generated dynamic workflow now pins
fetch-depth: 0on the setup-job checkout. Without it,affected_packagesfails on every PR because the default shallow checkout doesn't includeorigin/main. The static main workflow gets the same fix so dorny/paths-filter can diff on push events. - Generated workflow now includes a
workflow_dispatch:trigger and bypasses the affected-packages diff when triggered manually, so first-push (no diff base) and "force a full re-check" scenarios actually run CI against all packages instead of producing a green-but-empty run. - Generated workflow emits a GitHub notice when the diff yields no affected packages, pointing users at the manual Run workflow button so a skipped matrix isn't mistaken for a full pass.
- Bumped static action pins to
actions/checkout@v6so--no-update-actionsdoesn't ship a Node.js 20 deprecation warning. shorebird_ci generatenow bumps action versions to current latest automatically after writing the workflow files. Pass--no-update-actionsto skip the network call.shorebird_ci affected_packagesprints a friendly error instead of a Dart stack trace when run outside a git repository or against an unreachable base ref.--repo-rootdefaults togit rev-parse --show-toplevelwhen not specified, matching git's own behavior. Pass--repo-rootexplicitly to override.- README: remove stale "not yet on pub.dev" note; document why subpackages are covered both as standalone matrix jobs and inside the root Flutter job.
- Add
executables:declaration sodart pub global activate shorebird_cicreates ashorebird_cishim onPATH. Previously users had to invoke viadart pub global run shorebird_ci:shorebird_ci. (rolled in from the unreleased 0.1.1)
0.1.1 #
- Add
executables:declaration sodart pub global activate shorebird_cicreates ashorebird_cishim onPATH. Previously users had to invoke viadart pub global run shorebird_ci:shorebird_ci.
0.1.0 #
- Initial release.