@markjaquith/agency 2.20.0 → 2.22.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.
- package/README.md +23 -0
- package/cli.ts +13 -0
- package/package.json +1 -1
- package/src/cli-parser.test.ts +45 -1
- package/src/cli-parser.ts +158 -5
- package/src/cli.test.ts +62 -0
- package/src/commands/epic.ts +51 -1
- package/src/commands/phase.ts +94 -1
- package/src/commands/pr.ts +2 -2
- package/src/commands/task.ts +108 -1
- package/src/graph-schema.ts +2 -10
- package/src/services/ClaimService.ts +7 -2
- package/src/services/ContextService.ts +4 -4
- package/src/services/GraphMutationService.test.ts +336 -0
- package/src/services/GraphMutationService.ts +952 -0
- package/src/services/GraphService.ts +2 -11
- package/src/services/PullRequestService.test.ts +91 -4
- package/src/services/PullRequestService.ts +108 -31
- package/src/services/SyncService.test.ts +95 -1
- package/src/services/SyncService.ts +150 -60
- package/src/services/TaskPhaseService.test.ts +9 -1
- package/src/services/WorkbaseService.ts +5 -37
- package/src/test-utils.ts +2 -0
- package/src/workbase/delivery-command.test.ts +54 -0
- package/src/workbase/delivery-command.ts +135 -0
- package/src/workbase/dependency-graph.ts +51 -0
- package/src/workbase/schemas.test.ts +35 -0
- package/src/workbase/schemas.ts +23 -1
package/src/workbase/schemas.ts
CHANGED
|
@@ -51,6 +51,26 @@ const GitHubPullRequestUrl = NonEmptyString.pipe(
|
|
|
51
51
|
Schema.pattern(/^https:\/\/github\.com\/[^/]+\/[^/]+\/pull\/\d+\/?$/),
|
|
52
52
|
)
|
|
53
53
|
|
|
54
|
+
export const PullRequestRecord = Schema.Struct({
|
|
55
|
+
provider: EntityId,
|
|
56
|
+
repository: NonEmptyString,
|
|
57
|
+
identifier: NonEmptyString,
|
|
58
|
+
url: Url,
|
|
59
|
+
state: Schema.Literal("open", "closed", "merged"),
|
|
60
|
+
draft: Schema.Boolean,
|
|
61
|
+
merged: Schema.Boolean,
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const DeliveryProvider = Schema.Struct({
|
|
65
|
+
provider: EntityId,
|
|
66
|
+
remote: Schema.optional(NonEmptyString),
|
|
67
|
+
createCommand: Schema.NonEmptyArray(NonEmptyString),
|
|
68
|
+
queryCommand: Schema.NonEmptyArray(NonEmptyString),
|
|
69
|
+
environment: Schema.optional(
|
|
70
|
+
Schema.Record({ key: EnvironmentName, value: Schema.String }),
|
|
71
|
+
),
|
|
72
|
+
})
|
|
73
|
+
|
|
54
74
|
export const WorkbaseConfig = Schema.Struct({
|
|
55
75
|
version: Schema.Literal(2),
|
|
56
76
|
chooserCommand: Schema.optional(Schema.NonEmptyArray(NonEmptyString)),
|
|
@@ -67,6 +87,7 @@ export const WorkbaseConfig = Schema.Struct({
|
|
|
67
87
|
}),
|
|
68
88
|
}),
|
|
69
89
|
),
|
|
90
|
+
delivery: Schema.optional(DeliveryProvider),
|
|
70
91
|
})
|
|
71
92
|
|
|
72
93
|
export const LegacyWorkbaseRegistry = Schema.Struct({
|
|
@@ -96,7 +117,7 @@ const ExecutionUnit = {
|
|
|
96
117
|
repos: Schema.optional(Schema.Array(RepositoryReference)),
|
|
97
118
|
branch: NonEmptyString,
|
|
98
119
|
base: NonEmptyString,
|
|
99
|
-
pr: Schema.NullOr(GitHubPullRequestUrl),
|
|
120
|
+
pr: Schema.NullOr(Schema.Union(GitHubPullRequestUrl, PullRequestRecord)),
|
|
100
121
|
status: Schema.optionalWith(WorkStatus, { default: () => "open" as const }),
|
|
101
122
|
claim: Schema.optional(ClaimRecord),
|
|
102
123
|
}
|
|
@@ -141,6 +162,7 @@ export type Dependency = Schema.Schema.Type<typeof Dependency>
|
|
|
141
162
|
export type RepositoryReference = Schema.Schema.Type<typeof RepositoryReference>
|
|
142
163
|
export type WorkStatus = Schema.Schema.Type<typeof WorkStatus>
|
|
143
164
|
export type ClaimRecord = Schema.Schema.Type<typeof ClaimRecord>
|
|
165
|
+
export type PullRequestRecord = Schema.Schema.Type<typeof PullRequestRecord>
|
|
144
166
|
export type EpicFrontmatter = Schema.Schema.Type<typeof EpicFrontmatter>
|
|
145
167
|
export type TaskFrontmatter = Schema.Schema.Type<typeof TaskFrontmatter>
|
|
146
168
|
export type PhaseFrontmatter = Schema.Schema.Type<typeof PhaseFrontmatter>
|