Skip to content

test(hrr): skip the ownership stamp test where git has no ownership check - #14458

Merged
danielbolsson merged 4 commits into
developfrom
users/danielbolsson/hrr-stamp-test-skip
Oct 29, 2026
Merged

danielbolsson merged 4 commits into
developfrom
users/danielbolsson/hrr-stamp-test-skip

Conversation

@danielbolsson

@danielbolsson danielbolsson commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

JIRA ID : AIRUNTIME-3091

Motivation

test_checkout_owned_by_someone_else_reports_unknown (added by #14342) fails in the HRR script tests job on #13256 (run 40687541194): the stamp reports a revision, not unknown. That job is not a container job; it runs on a hosted ubuntu-24.04 runner with git 2.56.0 as user runner. Git there trusts every directory (a safe.directory = * in its system/global config), so GIT_TEST_ASSUME_DIFFERENT_OWNER=1 has no effect and reading the revision is correct. The test only means something where git enforces the ownership check.

Technical Details

projects/hrr/tests/scripts/test_version_stamp.py: probe git once at import, in the checkout the stamp reads (not a throwaway repo, so a checkout trusted through safe.directory in the user's git config also skips), with the same environment the test uses. If git does not refuse the repository, unittest.skipUnless skips the ownership test. Where git does enforce the check the test is unchanged and still fails against a stamp that bypasses it. The env setup moves into a shared git_env() helper.

Issue Tracking

JIRA ID : AIRUNTIME-3091

Test Plan

  • python3 -m unittest test_version_stamp with a normal git (test runs, passes).
  • Same with HOME pointing at a ~/.gitconfig holding safe.directory = * (test skipped, owned-repo test passes).
  • Negative control: add -c safe.directory=* to the stamp's git rev-parse and run with a normal git (test fails).

Test Result

  • Normal git 2.43.0: 2 run, OK. unittest discover over projects/hrr/tests/scripts: 152 tests OK.
  • safe.directory = * in HOME gitconfig: OK (skipped=1).
  • Negative control: FAILED (failures=1); change reverted.

Submission Checklist

Copilot AI balanced review requested due to automatic review settings October 28, 2026 13:36
@danielbolsson
danielbolsson requested a review from a team as a code owner October 28, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@andraghetti andraghetti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on gbt350 (git 2.55): the test runs and passes, fails with -c safe.directory=* in the stamp, and is skipped under safe.directory = *.

…s (AIRUNTIME-3091)

A probe in a fresh temporary repository still runs the test where the
checkout itself is trusted (safe.directory = <checkout> in the user's git
config), and there the test fails although the stamp is right. Probe the
checkout: it skips exactly where git trusts it and still fails a stamp that
bypasses the check.
@danielbolsson
danielbolsson merged commit de35f52 into develop Oct 29, 2026
80 of 81 checks passed
@danielbolsson
danielbolsson deleted the users/danielbolsson/hrr-stamp-test-skip branch October 29, 2026 16:54
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants