@bakers-build/addon-forge 0.8.1-next.5 → 0.8.1-next.7

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.
@@ -5,10 +5,14 @@ export declare const TITLE_REFUSAL = "the title must be a Conventional Commits s
5
5
  /** The run's own branch, or `<branch_name>-<suffix>`. */
6
6
  export declare function isOwned(branch: string, branchName: string): boolean;
7
7
  export declare function ownershipRefusal(branch: string, branchName: string): string;
8
- /** The ticket branch merges into `base_branch`; a variant into the ticket branch. */
8
+ /**
9
+ * The ticket branch merges into `target_branch` (a deployment's environment
10
+ * branch), else `base_branch`; a variant into the ticket branch.
11
+ */
9
12
  export declare function derivedBase(branch: string, run: {
10
13
  branchName: string;
11
14
  baseBranch: string;
15
+ targetBranch?: string;
12
16
  }): string;
13
17
  /** Remove every secret and any Authorization header value. */
14
18
  export declare function redact(text: string, secrets: readonly string[]): string;
package/dist/src/rules.js CHANGED
@@ -24,9 +24,14 @@ export function isOwned(branch, branchName) {
24
24
  export function ownershipRefusal(branch, branchName) {
25
25
  return `branch '${branch}' is not owned by this run: only '${branchName}' and '${branchName}-<suffix>' may be used`;
26
26
  }
27
- /** The ticket branch merges into `base_branch`; a variant into the ticket branch. */
27
+ /**
28
+ * The ticket branch merges into `target_branch` (a deployment's environment
29
+ * branch), else `base_branch`; a variant into the ticket branch.
30
+ */
28
31
  export function derivedBase(branch, run) {
29
- return branch === run.branchName ? run.baseBranch : run.branchName;
32
+ return branch === run.branchName
33
+ ? (run.targetBranch ?? run.baseBranch)
34
+ : run.branchName;
30
35
  }
31
36
  /** Remove every secret and any Authorization header value. */
32
37
  export function redact(text, secrets) {
@@ -30,7 +30,7 @@ export const FORGE_TOOL_DEFINITIONS = {
30
30
  },
31
31
  },
32
32
  forge_pr_upsert: {
33
- description: "Create the PR/MR of an owned branch into its base (base_branch, or the ticket branch for a variant), or update the open one's title and body. The title must be a Conventional Commits subject.",
33
+ description: "Create the PR/MR of an owned branch into its base (target_branch, which is base_branch unless a deployment names its environment branch; the ticket branch for a variant), or update the open one's title and body. The title must be a Conventional Commits subject.",
34
34
  input: {
35
35
  type: 'object',
36
36
  properties: {
package/dist/src/tools.js CHANGED
@@ -14,6 +14,7 @@ function runOf(req) {
14
14
  identifier: t.identifier,
15
15
  branchName: t.branchName,
16
16
  baseBranch: t.baseBranch,
17
+ ...(t.targetBranch ? { targetBranch: t.targetBranch } : {}),
17
18
  };
18
19
  }
19
20
  function ownedBranch(req, run) {
@@ -104,7 +105,7 @@ export function forgeTools(deps) {
104
105
  const run = runOf(req);
105
106
  const b = await backend();
106
107
  let ref;
107
- let base = run.baseBranch;
108
+ let base = run.targetBranch ?? run.baseBranch;
108
109
  if (typeof req.args.ref === 'string' && req.args.branch === undefined) {
109
110
  ref = req.args.ref;
110
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-forge",
3
- "version": "0.8.1-next.5",
3
+ "version": "0.8.1-next.7",
4
4
  "description": "bakers.build forge tools: a sandboxed run fetches, pushes its own branches, opens its PR/MR, reads checks and merges through the conductor, which holds the token. Backends implement the ForgeBackend contract (./backend).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "directory": "bakers-cli/addons/forge"
23
23
  },
24
24
  "peerDependencies": {
25
- "@bakers-build/conductor": "^0.8.1-next.5",
26
- "@bakers-build/core": "^0.8.1-next.5"
25
+ "@bakers-build/conductor": "^0.8.1-next.7",
26
+ "@bakers-build/core": "^0.8.1-next.7"
27
27
  },
28
28
  "bakersBuild": {
29
- "commit": "0a852637a4317a2ba18e831a2dcee4be2e67d060",
29
+ "commit": "4669f7b545a32fda92cee71129ff5aacc492a620",
30
30
  "channel": "next"
31
31
  }
32
32
  }