@davidvornholt/standards 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +5 -4
  2. package/package.json +12 -1
  3. package/src/cli.ts +283 -73
  4. package/src/creds-add-cloudflare-commit.ts +2 -5
  5. package/src/creds-add-github.ts +82 -30
  6. package/src/creds-add-policy.ts +106 -26
  7. package/src/creds-add-preflight.ts +68 -0
  8. package/src/creds-add.ts +29 -20
  9. package/src/creds-args.ts +5 -0
  10. package/src/creds-cloudflare-zone.ts +40 -0
  11. package/src/creds-commands.ts +21 -9
  12. package/src/creds-github-app-api.ts +132 -0
  13. package/src/creds-github-apps.ts +107 -0
  14. package/src/creds-login-github-manifest.ts +38 -15
  15. package/src/creds-login-github.ts +78 -24
  16. package/src/creds-plan-renew.ts +2 -5
  17. package/src/creds-sops-value.ts +89 -0
  18. package/src/creds-sops.ts +0 -53
  19. package/src/creds-store-github.ts +121 -0
  20. package/src/creds-store-lock-holder.ts +98 -0
  21. package/src/creds-store-lock-inspection.ts +125 -0
  22. package/src/creds-store-lock-lease.ts +32 -0
  23. package/src/creds-store-lock.ts +27 -51
  24. package/src/creds-store.ts +14 -43
  25. package/src/github-command-shared.ts +8 -1
  26. package/src/github-live-drift.ts +3 -3
  27. package/src/managed-files.ts +116 -14
  28. package/src/managed-path-ownership.ts +85 -0
  29. package/src/poller-closing-reference.ts +179 -0
  30. package/src/poller-fix-outcome.ts +9 -0
  31. package/src/poller-fix-publication.ts +5 -12
  32. package/src/poller-fix-run.ts +2 -3
  33. package/src/poller-fix-validation.ts +7 -8
  34. package/src/poller-outcome.ts +4 -1
  35. package/src/poller-protected-paths.ts +1 -25
  36. package/src/poller-protocol.ts +0 -42
  37. package/src/poller-review-publication.ts +2 -8
  38. package/src/poller-review-validation.ts +5 -12
@@ -1,10 +1,7 @@
1
1
  import type { ClaimBinding } from './poller-claim';
2
2
  import type { PullRequest } from './poller-github-pulls';
3
3
  import { failJob, type JobDeps, type JobLabels } from './poller-job-shared';
4
- import {
5
- changedWorkspaceQualityManifests,
6
- lockedPathsOf,
7
- } from './poller-protected-paths';
4
+ import { lockedPathsOf } from './poller-protected-paths';
8
5
  import { forbiddenDiffPaths, type ReviewOutcome } from './poller-protocol';
9
6
  import { publishReviewArtifacts } from './poller-review-artifacts';
10
7
  import {
@@ -89,10 +86,7 @@ export const finishReviewedJob = async (options: {
89
86
  const { deps, labels, pr, claim, workDir, outcome } = options;
90
87
  const commits = commitCount(workDir, pr.headSha);
91
88
  const paths = commits > 0 ? changedPaths(workDir, pr.headSha) : [];
92
- const forbidden = [
93
- ...forbiddenDiffPaths(paths, await lockedPathsOf(workDir)),
94
- ...changedWorkspaceQualityManifests(workDir, pr.headSha, paths),
95
- ];
89
+ const forbidden = forbiddenDiffPaths(paths, await lockedPathsOf(workDir));
96
90
  if (forbidden.length > 0) {
97
91
  await failJob(
98
92
  deps,
@@ -7,10 +7,7 @@ import {
7
7
  createValidationWorktree,
8
8
  isAncestor,
9
9
  } from './poller-output-integrity';
10
- import {
11
- changedWorkspaceQualityManifests,
12
- lockedPathsOf,
13
- } from './poller-protected-paths';
10
+ import { lockedPathsOf } from './poller-protected-paths';
14
11
  import { forbiddenDiffPaths } from './poller-protocol';
15
12
  import type { ReviewPublicationPlan } from './poller-review-output';
16
13
 
@@ -47,14 +44,10 @@ export const validateSealedReviewOutput = async (options: {
47
44
  ),
48
45
  );
49
46
  try {
50
- const forbidden = [
51
- ...forbiddenDiffPaths(paths, await lockedPathsOf(workspace.dir)),
52
- ...changedWorkspaceQualityManifests(
53
- workspace.dir,
54
- plan.approvedHead,
55
- paths,
56
- ),
57
- ];
47
+ const forbidden = forbiddenDiffPaths(
48
+ paths,
49
+ await lockedPathsOf(workspace.dir),
50
+ );
58
51
  if (forbidden.length > 0) {
59
52
  throw new Error(
60
53
  `publication blocked: sealed review modified protected paths:\n${forbidden.join('\n')}`,