chore(release): v0.1.0 #2

Merged
ComputerCrack merged 2 commits from develop into main 2026-10-11 01:10:51 +00:00

Summary

First release from develop to main.

 main
   583997b chore: initial project foundation
+  5fc0c74 ci: add merge-back workflow from main to develop (#1)

Merge with merge commit (not squash), then tag v0.1.0 (annotated, signed) on the merge commit.

Evidence

  • Before: sync-develop.yml has never run.
    After: this merge is a push to main and triggers it. Expected: PR main -> develop opened and merged automatically, merge commit signed by the instance.

Merge Danger

Door: two-way

Only CI configuration is added; reverting the merge removes it.

Blast Radius: develop

The triggered merge-back writes to develop.

## Summary First release from `develop` to `main`. ```diff main 583997b chore: initial project foundation + 5fc0c74 ci: add merge-back workflow from main to develop (#1) ``` Merge with **merge commit** (not squash), then tag `v0.1.0` (annotated, signed) on the merge commit. ## Evidence - **Before:** `sync-develop.yml` has never run. **After:** this merge is a push to `main` and triggers it. Expected: PR `main` -> `develop` opened and merged automatically, merge commit signed by the instance. ## Merge Danger **Door:** two-way Only CI configuration is added; reverting the merge removes it. **Blast Radius:** develop The triggered merge-back writes to `develop`.
## Summary

New workflow `.gitea/workflows/sync-develop.yml`, triggered by every push to `main`:

```text
on(push main)
  open PR main -> develop          (201 new | 409 reuse existing | 422 nothing to merge -> exit green)
  look up existing PR by base/head  (GET /pulls/develop/main, not "first open PR")
  approve PR via API               (develop requires 1 approval)
  merge PR via API (Do: merge)     (retry while 405 "not mergeable yet")
  on any other failure -> exit red, PR stays open for a human
```

Merge commit is created and signed by the Forgejo instance. Adapted from Portfolio `sync-dev.yml` with two changes: approval step added, existing-PR lookup fixed.

Refs: Netoskur-q5b

## Evidence

- **Before:** no merge-back; hotfixes on `main` would have to be brought to `develop` by hand.
  **After:** not yet verified. The workflow only runs on a push to `main`, so the first real run is the first release or hotfix. YAML parses; no comments in the file.

Open assumptions:
- `GET /repos/{owner}/{repo}/pulls/{base}/{head}` exists in this Forgejo version (known from the Gitea API).
- Repo secret `SYNC_TOKEN` is set (not yet, see ticket).

## Merge Danger

**Door:** two-way

Deleting the file disables it.

**Blast Radius:** develop

A wrong merge lands on `develop` only; `main` is never written. Without `SYNC_TOKEN` the job fails red and does nothing.

Reviewed-on: #1
## Summary

Repairs `.gitea/workflows/sync-develop.yml`. The approval step was still on `develop`, because PR #1 was merged before the removal commit arrived.

```diff
 on(push main)
+  concurrency group sync-develop, temp dir via mktemp, curl --max-time 30, token via header file
+  GET compare/develop...main: total_commits 0 -> exit green "nothing to merge"
-  open PR "Merge main into develop"
+  open PR "chore(sync): merge main into develop"        -> log "opened PR #n"
-  409: take PR number blindly
+  409: GET /pulls/develop/main, require HTTP 200 + state open -> log "reusing open PR #n"
-  422: exit green silently                               (wrong: Forgejo creates an EMPTY PR instead of 422)
+  422 / anything else: print body, exit red
+  mktemp failure: exit red
-  approve PR via API                                     (fails: self-approval)
   merge PR via API, retry on 405, else exit red and leave PR open
-  permissions block (unused)
```

Refs: Netoskur-5mg

## Evidence

- **Before:** `develop` (5fc0c74) contains the `APPROVED` review call (lines 55-61). Every run would exit 1 there.
  **After:** no approval call. Verified on this instance: an in-sync PR request creates an empty PR (test PR #4, closed), the compare API returns `total_commits`, `pulls/{base}/{head}` returns open PRs, and the JSON is compact. The YAML parses, and `bash -n` on the extracted run script passes. Not run yet: the first real run happens when release PR #2 is merged into `main`.

## Merge Danger

**Door:** two-way

Only CI config changes. Reverting restores the previous file.

**Blast Radius:** develop

The merge-back writes to `develop` only. With a missing or expired `SYNC_TOKEN`, it fails red without side effects.

Reviewed-on: #3
ComputerCrack referenced this pull request from a commit 2026-10-11 01:10:53 +00:00
Author
Owner

Resolution: finding 1 (approval step), plus findings 3, 4, 5 and the 422 handling, were fixed in PR #3 before this PR was merged. The 422 assumption turned out to be wrong: Forgejo creates an empty PR instead. The workflow now checks the compare API first.

**Resolution:** finding 1 (approval step), plus findings 3, 4, 5 and the 422 handling, were fixed in PR #3 before this PR was merged. The 422 assumption turned out to be wrong: Forgejo creates an empty PR instead. The workflow now checks the compare API first.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ComputerCrack/Netoskur!2
No description provided.