Skip to content

Investigation: doc-bot fetch step fails on zero-match wildcard refspec - #25699

Closed
mshabarov with Claude wants to merge 1 commit into
mainfrom
claude/fix-count-nested-jars-in-token-file-lookup
Closed

mshabarov with Claude wants to merge 1 commit into
mainfrom
claude/fix-count-nested-jars-in-token-file-lookup

Conversation

@Claude

@Claude Claude AI commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Investigation only — no code changes. The Documentation Bot run on PR #25681 failed and did not open a PR in vaadin/docs.

Findings

  • Failure point: job agent, step 6 Fetch additional refs for vaadin/docs — exits 1 in ~300 ms, before the Claude agent starts. All subsequent steps skipped.
  • Command: git fetch origin --depth=1 '+refs/heads/doc-bot/*:refs/remotes/origin/doc-bot/*' against vaadin/docs.
  • Root cause: the wildcard matches zero remote refs (vaadin/docs has no doc-bot/* branches — verified across all ~200 branches). git 2.55 on the runner treats a zero-match wildcard fetch as an error. Stderr is scrubbed because VAADIN_BOT_TOKEN is passed via http.extraheader, which is why the log looks empty.
  • PR in vaadin/docs: none. No PR references vaadin/flow#25681; no doc-bot/* branch was pushed.

Why no fix in this branch

  • Failure is in .github/workflows/doc-bot.md:100 (fetch: ['doc-bot/*']), compiled by gh-aw into doc-bot.lock.yml. The lock file is generated; hand-editing it would be overwritten on the next compile.
  • This branch targets an unrelated Java fix (nested-jar token lookup, already merged as bbf4fb4). Bundling a workflow change here would violate minimal-scope conventions and needs sign-off from the doc-bot workflow owners.

Suggested follow-up (separate PR against doc-bot.md)

Make the fetch tolerate a zero-match wildcard, e.g.:

- name: Fetch additional refs for vaadin/docs
  run: |
    header=$(printf "x-access-token:%s" "${GH_AW_FETCH_TOKEN}" | base64 -w 0)
    git -C "${{ github.workspace }}/docs-repo" \
        -c "http.extraheader=Authorization: Basic ${header}" \
        fetch origin --depth=1 '+refs/heads/doc-bot/*:refs/remotes/origin/doc-bot/*' || true

or drop the pre-fetch entirely and let the agent create the branch fresh — the prior actions/checkout of main is sufficient for the doc-bot to branch from.

@cla-assistant

cla-assistant Bot commented Sep 14, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant

cla-assistant Bot commented Sep 14, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Claude Claude AI linked an issue Sep 14, 2026 that may be closed by this pull request
@Claude Claude AI changed the title [WIP] Fix Documentation Bot workflow failure Investigation: doc-bot fetch step fails on zero-match wildcard refspec Sep 14, 2026
@Claude
Claude AI requested a review from mshabarov September 14, 2026 08:43
@mshabarov

Copy link
Copy Markdown
Contributor

@claude what do you suggest? Would "let the agent create the branch fresh" be better working solution?

@claude

claude Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Claude finished @mshabarov's task in 1m 35s —— View job


Recommendation on the zero-match fetch fix

I read the source and the generated lock file. Short version: I'd go with the tolerant fetch (|| true / zero-match-safe), not "create the branch fresh." Dropping the fetch fixes the crash but quietly removes a feature.

Why the fetch exists (it's not just decoration)

fetch: ['doc-bot/*'] (.github/workflows/doc-bot.md:100) is documented right above it:

# `doc-bot/*` brings in the branch of an
# existing documentation pull request, which Phase 5b commits onto.

That branch is what powers the push-to-pull-request-branch safe-output (doc-bot.md:125-129): when a docs PR already exists for the same source PR (re-run, or the source PR gets more commits), the bot updates that PR instead of opening a second one.

Why "create the branch fresh" is the weaker option

fetch: ['doc-bot/*'] compiles into the identical Fetch additional refs step in two jobs:

  • the agent job — doc-bot.lock.yml:495-500
  • the safe-output/push job — doc-bot.lock.yml:1882-1888

The safe-output job fetches doc-bot/* precisely so the push handler has the existing branch locally to commit onto. So if you drop the pre-fetch to "branch fresh," you don't just change where the branch comes from — you remove the update-in-place path. The likely result on re-runs / multi-commit PRs is duplicate docs PRs rather than one that gets updated. That defeats the whole push-to-pull-request-branch block.

(Also worth noting: because that step is in both jobs, the zero-match crash isn't specific to updates — even a first-time create_pull_request would hit the zero-match fetch in the safe-output job. So the tolerant fetch is what actually makes the common case work, not just the update case.)

The catch with || true

The || true in the follow-up snippet is shown against the generated doc-bot.lock.yml, which gets overwritten on the next gh-aw compile. There's no || true knob on the fetch: checkout option today, so the real fix has to land at the source, one of:

  1. Upstream in gh-aw (githubnext/gh-aw) — make a wildcard fetch: refspec tolerate zero matches (this is arguably a compiler bug: git 2.55 errors on zero-match wildcards). Cleanest long-term, benefits every workflow, keeps behavior intact.
  2. Replace fetch: with a custom tolerant step in doc-bot.md (if gh-aw lets you author raw steps) that runs the same fetch with || true — a local workaround until (1) lands.

Bottom line

  • Best: tolerant fetch, preferably fixed in gh-aw (option 1). Preserves idempotent docs-PR updates and fixes the crash everywhere the step is generated.
  • Acceptable quick unblock: "branch fresh" only if the owners are fine losing update-in-place and accept possible duplicate docs PRs. Given the PRs are draft with if-no-changes: ignore and a 30-day expiry, duplicates aren't catastrophic — but it's a real behavior regression, not a free simplification.

So to your question directly: no, I don't think "create the branch fresh" is the better working solution — it's the simpler one, but it trades away the deduplication the workflow was designed to do.

On implementing it here

I can't make this change myself — it lives under .github/workflows/, which I don't have permission to modify, and it's out of scope for this branch (unrelated Java fix) per the minimal-scope convention. This needs a separate PR against doc-bot.md (or an upstream gh-aw issue) with sign-off from the doc-bot workflow owners, as #25698 notes.
· branch claude/fix-count-nested-jars-in-token-file-lookup

@mshabarov mshabarov closed this Sep 14, 2026
samie pushed a commit to samie/flow that referenced this pull request Sep 15, 2026
…din#25701)

Fixes vaadin#25698
Related to vaadin#25699

**build failure** · `.github/workflows` · the Documentation Bot on every
merge into `main`

**Background — agentic workflows.** The Documentation Bot is written as
a
GitHub Agentic Workflow: a Markdown file holds its configuration and its
prompt, and the `gh aw compile` command turns that file into the
`.lock.yml`
workflow GitHub runs. The lock file is generated, so a fix belongs in
the
Markdown source and the lock file is regenerated from it.

Every Documentation Bot run since 3 September has failed: the run stops
in
the step that fetches extra branches from the documentation repository,
before the agent starts, and prints nothing that explains why. No
documentation pull request is opened for a merged change, and a re-run
fails the same way.

**Risks:**
- ✅ Nothing to flag — no API, behavior, security, serialization,
  threading, memory or migration impact. The change adds one matching
  refspec to a fetch that already runs, in a workflow file.

**Context.** The fetch list held only `doc-bot/*`, the branch of an
already
open documentation pull request, which the bot commits onto so that a
re-run updates that pull request instead of opening a second one. The
list
compiles into a single `git fetch --depth=1`, and a shallow fetch whose
refspecs all match nothing exits 1 in silence — which is what happens
whenever no documentation pull request is open, so almost always.

- Added `main` next to `doc-bot/*` in the `fetch:` list of the
  `vaadin/docs` checkout, so one refspec always matches and the step
  succeeds whether or not a documentation pull request is open.
- The step is generated into both the agent job and the safe-output job,
so the failure hit the first documentation pull request for a change as
    well as an update to an existing one.
- `main` costs nothing to fetch: it is the ref the checkout already
pulls.
- Kept `doc-bot/*` in the list, so a re-run still updates an open
  documentation pull request instead of opening a second one.
- Explained in the comment above the checkout why `main` is listed, so
it
  is not dropped later as redundant.
- Regenerated `doc-bot.lock.yml` with `gh aw compile` v0.86.2, the
version
  that generated the current lock file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Documentation Bot failed

2 participants