Skip to content

fix: set XIsResourceName for immutable rule API calls during force project delete#990

Open
rakshityadav1868 wants to merge 1 commit into
goharbor:mainfrom
rakshityadav1868:fix-immutable-numeric-project-name
Open

fix: set XIsResourceName for immutable rule API calls during force project delete#990
rakshityadav1868 wants to merge 1 commit into
goharbor:mainfrom
rakshityadav1868:fix-immutable-numeric-project-name

Conversation

@rakshityadav1868

@rakshityadav1868 rakshityadav1868 commented Jun 13, 2026

Copy link
Copy Markdown

Fixes #981
When deleting a project with a numeric name using force, the immutable rule APIs were not telling Harbor to treat the value as a project name. Harbor interpreted it as an ID instead, so the CLI failed to find and remove the immutable rules. This caused repository deletion to fail with an HTTP 412 error and blocked the entire project deletion.

The fix sets XIsResourceName true on ListImmutable and DeleteImmutable API calls so Harbor correctly resolves the value as a project name, allowing projects with numeric names to be force deleted successfully.

BEFORE:

Screen.Recording.2026-06-13.at.6.31.05.PM.mp4

AFTER:

Screen.Recording.2026-06-13.at.6.35.46.PM.mp4

@rakshityadav1868 rakshityadav1868 marked this pull request as draft June 13, 2026 12:51
@rakshityadav1868 rakshityadav1868 force-pushed the fix-immutable-numeric-project-name branch from dd96da7 to 95cf589 Compare June 13, 2026 12:53
@rakshityadav1868 rakshityadav1868 marked this pull request as ready for review June 13, 2026 12:53
…ames resolve correctly during force delete

Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
@rakshityadav1868 rakshityadav1868 force-pushed the fix-immutable-numeric-project-name branch from 95cf589 to 5f0a40d Compare June 13, 2026 12:54
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.17%. Comparing base (60ad0bd) to head (5f0a40d).
⚠️ Report is 187 commits behind head on main.

Files with missing lines Patch % Lines
pkg/api/immutable_handler.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #990      +/-   ##
=========================================
- Coverage   10.99%   9.17%   -1.82%     
=========================================
  Files         173     321     +148     
  Lines        8671   16083    +7412     
=========================================
+ Hits          953    1475     +522     
- Misses       7612   14474    +6862     
- Partials      106     134      +28     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[bug]: Delete is failing on some projects

2 participants