@remogram/provider-gitea-api 0.1.0-beta.5 → 0.1.0-beta.6

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 (2) hide show
  1. package/index.js +5 -13
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  gitAheadBehind,
11
11
  refsInventory,
12
12
  crInventory,
13
- buildMergePlanBodyFromFacts,
13
+ buildMergePlanFromProviderFacts,
14
14
  buildChangeRequestOpenedBody,
15
15
  buildCommitStatusSetBody,
16
16
  parseStatusSetArgs,
@@ -56,6 +56,7 @@ import {
56
56
  buildOpenPullListMeta,
57
57
  giteaOpenPullSortQuery,
58
58
  appendSortQuery,
59
+ assertWriteCommandConfigured,
59
60
  } from '@remogram/core';
60
61
  const PUBLIC_GITEA_HOST = 'gitea.com';
61
62
  const PUBLIC_GITEA_API = 'https://gitea.com/api/v1';
@@ -648,6 +649,7 @@ export async function findCommitStatusByContext(ctx, sha, context) {
648
649
  }
649
650
 
650
651
  export async function statusSet(ctx, args) {
652
+ assertWriteCommandConfigured(ctx.config, 'status_set');
651
653
  const parsed = parseStatusSetArgs(args);
652
654
  const existing = await findCommitStatusByContext(ctx, parsed.sha, parsed.context);
653
655
  if (existing) {
@@ -676,6 +678,7 @@ export async function statusSet(ctx, args) {
676
678
  }
677
679
 
678
680
  export async function crOpen(ctx, { head, base, title, body: prBody }) {
681
+ assertWriteCommandConfigured(ctx.config, 'cr_open');
679
682
  assertGitRef(head, 'head');
680
683
  assertGitRef(base, 'base');
681
684
  if (!title || typeof title !== 'string' || !title.trim()) {
@@ -970,18 +973,7 @@ export function summarizeChecks(statuses) {
970
973
  }
971
974
 
972
975
  export async function mergePlan(ctx, opts) {
973
- const view = await prView(ctx, opts);
974
- const checks = await prChecks(ctx, { number: view.pr_number });
975
- let mergeOpts = opts;
976
- if (opts.allowed_paths) {
977
- try {
978
- const crFilesBody = await crFiles(ctx, { number: view.pr_number });
979
- mergeOpts = { ...opts, changed_paths: crFilesBody.changed_paths };
980
- } catch {
981
- // Fall back to local git diff in resolveMergePlanPathScope.
982
- }
983
- }
984
- return buildMergePlanBodyFromFacts(ctx, view, checks, mergeOpts);
976
+ return buildMergePlanFromProviderFacts(ctx, opts, { prView, prChecks, crFiles });
985
977
  }
986
978
 
987
979
  export async function syncPlan(ctx, remoteName = 'origin') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remogram/provider-gitea-api",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.6",
4
4
  "description": "Gitea REST API forge provider for remogram",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,6 +22,6 @@
22
22
  "node": ">=20"
23
23
  },
24
24
  "dependencies": {
25
- "@remogram/core": "0.1.0-beta.5"
25
+ "@remogram/core": "0.1.0-beta.6"
26
26
  }
27
27
  }