Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tc for limited guest of a project to get repository #20311

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

zyyw
Copy link
Contributor

@zyyw zyyw commented Apr 19, 2024

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #19878

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • 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"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@zyyw zyyw added area/test automation/nightly-testing release-note/infra Infra related changes e.g. release, test, ship etc... target/2.11.0 labels Apr 19, 2024
@zyyw zyyw requested a review from a team as a code owner April 19, 2024 12:10
@zyyw zyyw force-pushed the tc-limited-guest-getRepository branch from 512c0dd to b2e78f3 Compare April 19, 2024 12:14
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.28%. Comparing base (b7b8847) to head (2ee5189).
Report is 150 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #20311       +/-   ##
===========================================
- Coverage   67.56%   46.28%   -21.29%     
===========================================
  Files         991      247      -744     
  Lines      109181    13750    -95431     
  Branches     2719     2827      +108     
===========================================
- Hits        73768     6364    -67404     
+ Misses      31449     7062    -24387     
+ Partials     3964      324     -3640     
Flag Coverage Δ
unittests 46.28% <ø> (-21.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1238 files with indirect coverage changes

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

#3. Add user(UA) as a member of project(PA) with "Limited Guest" role;
with created_project(metadata={"public": "false"}, user_id=user_id, member_role_id=5) as (project_id, project_name):
#4. Push an image to project(PA) by user(UA), then check the project quota usage;
image, tag = "goharbor/alpine", "3.10"
Copy link
Member

Choose a reason for hiding this comment

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

We can define these variables in setUp.

Comment on lines +56 to +57
#6. Delete repository(RA)
self.repository.delete_repository(project_name, "goharbor%2Falpine", **ADMIN_CLIENT)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this step should be in tearDown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it has to be within the with created_project, otherwise with created_project cannot delete the project itself because there is repository within the project to be deleted.

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

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

lgtm

@zyyw zyyw enabled auto-merge (squash) April 22, 2024 06:27
@zyyw zyyw merged commit 9b164f3 into goharbor:main Apr 22, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test automation/nightly-testing release-note/infra Infra related changes e.g. release, test, ship etc... target/2.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Limited Guest role member permission API test case
8 participants