Skip to content

SLING-13253 - update-local-site: fix problems found running the website update - #50

Merged
royteeuwen merged 2 commits into
masterfrom
feature/SLING-13253-site-update-fixes
Aug 18, 2026
Merged

SLING-13253 - update-local-site: fix problems found running the website update#50
royteeuwen merged 2 commits into
masterfrom
feature/SLING-13253-site-update-fixes

Conversation

@royteeuwen

Copy link
Copy Markdown
Contributor

Stack: 1 of 2#48 (shallow clone) builds on this.

Split out of #48 per review feedback: those were fixes rather than part of the shallow-clone change, and belong lower in the stack. All three are problems that only showed up running the website update against a real checkout, not in the unit tests as they were.

ensureRepo reset the wrong branch. It hard-reset whatever branch happened to be checked out. Since the checkout location is configurable it may be one someone else is using, whose branch would be reset and the release then committed onto it. The published branch is now checked out explicitly first.

Commits recorded the wrong committer. Only the author was set, so JGit derived the committer from the process user and hostname — root@<container id> inside the image. Both are now set.

A false "add it by hand" warning. An entry that already carried the released version was reported as missing from the downloads page, because the result could not distinguish an absent entry from an up-to-date one. Re-running finalize therefore raised a false alarm on every re-run; the two cases are now separate.

Also silences JGit's filesystem-timestamp-resolution warning, which it emits when it cannot measure the resolution of the directory holding the checkout. It reads like a failure mid-release and there is nothing to act on.

Verified: full build green on its own (176 tests). The committer fix in particular was caught by the real-repository tests added in #40 — the previous mocked version asserted against itself and could not see it.

…te update

Three problems that only a real run against a real checkout shows.

ensureRepo hard-reset whatever branch happened to be checked out. Because the
checkout location is configurable it may be a checkout someone else is using,
whose branch would then be reset and the release committed onto it, so the
published branch is now checked out explicitly first.

Commits set the committer as well as the author: the container has no git
identity, so JGit derived one from the process user and hostname, producing
commits committed by root@<container id>.

An entry that already carried the released version was reported as missing from
the downloads page, because the result could not distinguish an absent entry
from an up-to-date one. Re-running finalize therefore raised a false alarm; the
two cases are now separate.

Also silences JGit's filesystem timestamp resolution warning, which it emits
when it cannot measure the resolution of the directory holding the checkout. It
looks like a failure mid-release and there is nothing to act on.
Checking out the published branch was not preceded by discarding the working
tree, so it threw CheckoutConflictException whenever the configured checkout was
on another branch with an uncommitted change to a file whose content differs
between that branch and the published one - exactly the case the branch handling
exists for. The working tree is now reset before switching. The previous test did
not catch this because it branched at the same commit, making the switch a no-op;
the new one commits a divergent change first.

The downloads page outcome was decided on counters summed over all of a
release's artifact ids, so a single already-current entry hid siblings that were
missing altogether and the message claimed ids were listed when they were not.
It also made the other-major message unreachable whenever anything was current.
Each artifact id is now classified on its own and every category reported with
the ids that actually belong to it.

Also closes the Git returned by the clone, which leaked the repository and its
pack handles for the rest of the process.
@royteeuwen
royteeuwen force-pushed the feature/SLING-13253-site-update-fixes branch from 34b037a to a6afb9a Compare August 14, 2026 19:25
@royteeuwen

Copy link
Copy Markdown
Contributor Author

Rebased onto master (which now carries the image rename from #41) and pushed two further fixes found while reviewing this branch:

  • ensureRepo could throw CheckoutConflictException. Switching to the published branch was not preceded by discarding the working tree, so it failed whenever the configured checkout sat on another branch with an uncommitted change to a file whose content differs between the two — exactly the situation the branch handling exists for. The earlier test missed it because it branched at the same commit, making the switch a no-op; the new test commits a divergent change first, and I confirmed it reproduces CheckoutConflict without the fix.
  • An up-to-date downloads entry could hide a missing sibling. The outcome was decided on counters summed over all of a release's artifact ids, so for a multi-artifact release (sling-mock has .core/.junit4/.junit5) one already-current entry suppressed the warning about one that was absent, and the message named ids as listed that were not. Each artifact id is now classified on its own. Also confirmed to fail without the fix.

Plus closing the Git returned by the clone, which leaked the repository and its pack handles.

@sonarqubecloud

Copy link
Copy Markdown

@royteeuwen
royteeuwen merged commit 597a042 into master Aug 18, 2026
3 checks passed
@royteeuwen
royteeuwen deleted the feature/SLING-13253-site-update-fixes branch August 18, 2026 19:12
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