fix noisy update license PR

Open
#126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions
Domain
ci-cd

Research direction

Locate the nightly license-update workflow and inspect how it compares source licenses with the existing pull request branch. Reproduce the no-change third-night case, then verify that the workflow exits early when the PR branch already contains the latest license files while still updating for a genuinely new license.

Written by the indexing model from the issue text.

Description

Description

A cron job runs nightly to keep the list of license up to date. It is supposed to exit early if there haven't been any changes since the last update of the PR it manages. But once there is a change to license files, it always registers a change.

Expected Behavior
  • cron runs 1st night and there are no new licenses -- workflow exits early
  • cron runs 2nd night and there are 2 new licenses -- creates the branch, makes a commit with the new licenses, and creates a PR
  • cron runs 3rd night and there are no new licenses -- workflow exits early
  • cron runs 4th night and there is 1 new license -- creates a commit to the existing branch with the new license and updates the existing PR
Actual Behavior
  • cron runs 1st night and there are no new licenses -- workflow exits early (CORRECT)
  • cron runs 2nd night and there are 2 new licenses -- creates the branch, makes a commit with the new licenses, and creates a PR (CORRECT)
  • cron runs 3rd night and there are no new licenses -- updates the existing PR (WRONG)
  • cron runs 4th night and there is 1 new license -- creates a commit to the existing branch with the new license and updates the existing PR (CORRECT)

The PR updates on the 3rd night because the source licenses are being compared against the main branch instead of the PR's branch. This makes the license files appear to be different even though there are no new changes on the 3rd night.

Dominant language
Go
Stars
53
Forks
16
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/go-spdx

All issues in github/go-spdx

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.