Skip to content

ci(reward): keep reward tags off Latest and out of git describe - #920

Open
FenjuFu wants to merge 1 commit into
iflytek:mainfrom
FenjuFu:ci/reward-tags-detached
Open

FenjuFu wants to merge 1 commit into
iflytek:mainfrom
FenjuFu:ci/reward-tags-detached

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Oct 3, 2026

Copy link
Copy Markdown
Member

Summary

  • What changed? The reward bot now tags a detached empty commit, and the monthly statistic release no longer becomes "Latest".

    • share-reward.ts / count-reward.ts point new reward-* / statistic-* tags at a parentless empty-tree commit, created by .github/scripts/git.ts. The merge commit SHA stays in that commit's message.
    • statistic-* releases are created with --latest=false.
    • statistic-member-reward.yml drops the git describe --match "statistic-*" pre-check, which cannot see detached tags. count-reward.ts already exits when the previous month has no reward data.
  • Why is this needed? We hit both problems in iflytek/astron-agent, which uses the same reward scripts (Document the stable release channel and keep reward releases from taking "Latest" astron-agent#1694, fixed in chore: make vX.Y.Z the stable release channel (docs, Helm, reward tags) astron-agent#1695):

    • "Latest" release: gh release create without --latest=false lets the API default (make_latest: true) mark statistic-2026-09 as the repository's Latest release for a week. Anything that resolves releases/latest would have received a reward summary instead of a product release. In skillhub, that would mean losing v0.2.x (or a cli-v* release) as Latest.
    • git describe: tags on product commits become the nearest tag for later commits. In astron-agent, 36 of the last 400 commits on main describe as reward-1575-N-g… / statistic-2026-09-N-g…, compared with 12 as v1.1.1-N-g….

    skillhub has no reward or statistic tags yet, so this change prevents the problem before the first payout. No existing tags need migrating.

Validation

  • Backend tests passed
  • Frontend typecheck/build passed
  • OpenAPI SDK regenerated or checked when API contracts changed
  • Smoke test run when relevant

I tested this end-to-end in a sandbox repo with a local bare remote, Deno 2.9 and a fake gh on PATH. The repo had a v1.0.0 tag followed by two more commits.

  1. I ran the new tagging and push code from this branch's share-reward.ts (via createDetachedCommit), with a reward dated last month. It created reward-42 on a commit with no parents and the empty tree (4b825dc), and the commit message records the merge SHA.
  2. I ran this branch's count-reward.ts unmodified. It found the tag by creator date and produced @bob / CNY RMB: 300. It pushed statistic-2026-10 on a second detached commit and called gh release create statistic-2026-10 --latest=false --notes ….
  3. git describe --tags HEAD still returned v1.0.0-2-g…. The remote held all 3 tags, and no git identity was left in the local config.

Risk

  • User-facing impact: none. Reward comments, tag contents and statistic releases look the same. Only the commit a reward tag points at changes, and that commit's message keeps the merge SHA.
  • Deployment or migration impact: none.
  • Rollback approach: revert this commit.

Notes

reward-* tags pointed at PR merge commits and statistic-* tags at the
default branch HEAD, so they became the nearest tag in git describe for
later commits. statistic-* releases were also created without
--latest=false, so the GitHub API marked them as the Latest release.

- Point new reward-* / statistic-* tags at a parentless empty-tree commit
  (the merge commit SHA is kept in its message) so no branch reaches them;
  tag contents and dates are read as before
- Create statistic-* releases with --latest=false
- Drop the describe-based "new commits since last statistic" check, which
  cannot see detached tags; count-reward.ts already exits when there is
  no reward data for the previous month

Same fix as iflytek/astron-agent#1695.

Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

1 participant