harbor icon indicating copy to clipboard operation
harbor copied to clipboard

fix: Adding fix for inconsistent behavior when deleting retention policy.

Open miledxz opened this issue 7 months ago • 3 comments

Issue being fixed

Fixes #(https://github.com/goharbor/harbor/issues/21783)

Adding implementation of deleting retention policy value from the project table that's referenced by retention policy ref field

Please indicate you've done the following:

  • [x] Well Written Title and Summary of the PR
  • [x] Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • [x] Accepted the DCO. Commits without the DCO will delay acceptance.
  • [x] Made sure tests are passing and test coverage is added if needed.
  • [x] Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

miledxz avatar May 20 '25 08:05 miledxz

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 46.57%. Comparing base (c8c11b4) to head (bfb0aff). :warning: Report is 568 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #22014      +/-   ##
==========================================
+ Coverage   45.36%   46.57%   +1.21%     
==========================================
  Files         244      253       +9     
  Lines       13333    14238     +905     
  Branches     2719     2925     +206     
==========================================
+ Hits         6049     6632     +583     
- Misses       6983     7252     +269     
- Partials      301      354      +53     
Flag Coverage Δ
unittests 46.57% <ø> (+1.21%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more. see 178 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar May 20 '25 08:05 codecov[bot]

@miledxz DCO, is required

Vad1mo avatar May 20 '25 15:05 Vad1mo

@miledxz DCO, is required

Hi @Vad1mo thanks for the fast feedback, I have added DCO, now I have to fix test here, https://github.com/goharbor/harbor/actions/runs/15144959414/job/42578306914?pr=22014#step:7:2557

but to make sure this test passes locally I have to run migrations and use Postgres database, do you know maybe how could I setup that properly ? I have tried locally but could not run migrations for some reason, I think I'm missing something

gentle ping for @bupd

Thanks for the help in advance !

miledxz avatar May 21 '25 06:05 miledxz

@miledxz Instead of creating a new function named delete retentionid we should just use the update function in projectMetadat dao and remove the retentionID from the project.

bupd avatar Jun 19 '25 21:06 bupd

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

github-actions[bot] avatar Aug 19 '25 09:08 github-actions[bot]

/label never-stale

bupd avatar Aug 19 '25 10:08 bupd