bug: dispatcher PR lookup fails — --diff-filter=A misses merge commits #129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The dispatcher's
get_pr_for_file()function cannot find the PR that introduced a vault action TOML file. It logsWARNING: No PR found for action ... — skipping (possible direct push)even when the file arrived via a properly merged PR.Root cause
get_pr_for_file()uses:--diff-filter=Areturns the commit that directly added the file (e.g.4d43b96 vault: release v0.2.0). This is the commit on the PR branch, not the merge commit. The function then checks if this commit message contains "Merge pull request" — it doesn't, because it's a regular commit.The actual merge commit (
1ad1326 Merge pull request ... (#3)) is a separate commit that doesn't show up with--diff-filter=A.Fix
Replace the current approach with a two-step lookup:
Tested inside the edge container:
Also fix: empty secrets should not be an error
The dispatcher currently fails with
ERROR: Action ... has no secrets declaredwhensecrets = []. An action with no secrets (like a release tag) is valid — the runner just doesn't get any extra env vars. Remove this check or make it a no-op for empty arrays.Also fix: edge container env vars
The edge service in docker-compose.yml (and
bin/disintogenerate_compose) needs these environment variables for the dispatcher to function:FORGE_URL: http://forgejo:3000FORGE_REPO: johba/disintoFORGE_OPS_REPO: dev-bot/disinto-opsFORGE_TOKEN: ${FORGE_TOKEN:-}OPS_REPO_ROOT: /opt/disinto-opsPROJECT_REPO_ROOT: /opt/disintoPRIMARY_BRANCH: mainDISINTO_VERSION: ${DISINTO_VERSION:-main}And the entrypoint needs
export USER="${USER:-root}"before sourcing lib/env.sh (Alpine doesn't set USER).Also fix:
FORGE_APIconstructionThe dispatcher sources lib/env.sh which builds
FORGE_APIfromFORGE_URLandFORGE_REPO. But for ops repo API calls, the dispatcher usesFORGE_APIwhich points to the disinto repo, not the ops repo. PR lookup calls likeget_pr_mergeruseFORGE_APIbut should use${FORGE_URL}/api/v1/repos/${FORGE_OPS_REPO}.Affected files
docker/edge/dispatcher.sh(fixget_pr_for_file, remove empty-secrets error, fix API URL for ops repo)docker/edge/entrypoint-edge.sh(addUSERexport)docker-compose.yml/bin/disintogenerate_compose (add env vars to edge service)Acceptance criteria
get_pr_for_file()finds PRs via ancestry-path merge lookupsecrets = []pass validation