Skip to content

Keep docs:ready when it was applied after the docs check started - #47

Open
fivetran-data-model-bot wants to merge 1 commit into
mainfrom
fix/keep-docs-ready-label
Open

fivetran-data-model-bot wants to merge 1 commit into
mainfrom
fix/keep-docs-ready-label

Conversation

@fivetran-data-model-bot

Copy link
Copy Markdown
Contributor

Summary

  • Since changelog entries moved to .changes/*.yml (Changelog poc/initial test #40), the usual flow is to push the entry and apply docs:ready a few seconds later. .changes/ edits count as relevant, so the check for that push reports stale (correctly) and then removes the label, even though the label already started a docs run for that commit. After that run succeeds, the label is gone while the docs are current.
  • Before removing docs:ready, check-docs-current.yml now compares the label's most recent labeled event with when this check run was triggered (created_at, or run_started_at for a re-run). If the label is newer, the check leaves it for the docs run. If that run fails, generate-docs.yml already removes the label.
  • If either API lookup fails, the check falls back to removing the label, as it does today.
  • The docs/generated status is unchanged: it still reports stale until the docs run pushes.
  • README: finished the cut-off sentence describing the check and added the new behavior.

Real-world repro

dbt_intercom#91 on 11/3:

  • 50ffd29 (only .changes/1.8.1.yml) pushed at 17:16:02, and its check started at 17:16:11.
  • docs:ready applied at 17:16:13, and the docs run started at 17:16:16.
  • The check finished stale and removed the label at 17:16:19.
  • The docs run pushed caba985 at 17:17:38, and the check reported "Docs and changelog current", but the label stayed off.

Related

Pairs with #46, which covers a different race: two docs runs from applying the label twice. This PR covers the check from your own push removing a label you just applied. #46's "Not covered here" section describes this case.

Test plan

  • YAML parses
  • Ran the timestamp comparison against dbt_intercom#91's real data (check 17:16:11, label 17:16:13) → keeps the label
  • After merge, on a package PR, push a .changes/ edit and apply docs:ready right away. The label should stay through the docs run, and docs/generated should end green.
  • Push a model change without applying the label. The label should still be removed.

🤖 Generated with Claude Code

Since changelog entries moved to .changes/*.yml, the usual flow is to
push the entry and apply docs:ready seconds later. The check for that
push then removed the label even though it had already started a docs
run, so the label no longer reflected that docs were current.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants