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

Upgrade Harbor api client #2

Merged
merged 16 commits into from
Jan 30, 2023
Merged

Upgrade Harbor api client #2

merged 16 commits into from
Jan 30, 2023

Conversation

alexandre-k
Copy link
Contributor

@alexandre-k alexandre-k commented Dec 23, 2022

Motivation

Several bugs exist on the current client. E.g.: updating quota, listing artifacts, etc require direct calls with requests or other libraries to make raw http calls.

Goals

  • Generate a client from Harbor
  • Create a package
  • Update doc

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 26, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 32.82%.

Quality metrics Before After Change
Complexity 4.41 ⭐ 0.21 ⭐ -4.20 👍
Method Length 58.65 ⭐ 12.59 ⭐ -46.06 👍
Working memory 5.35 ⭐ 2.09 ⭐ -3.26 👍
Quality 66.79% 🙂 99.61% 32.82% 👍
Other metrics Before After Change
Lines 66131 5001 -61130
Changed files Quality Before Quality After Quality Change
setup.py 82.75% ⭐ 84.30% ⭐ 1.55% 👍
test/test_access.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_addition_link.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_addition_links.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_annotations.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_artifact.py 84.85% ⭐ 99.75% ⭐ 14.90% 👍
test/test_artifact_api.py 99.89% ⭐ 99.68% ⭐ -0.21% 👎
test/test_audit_log.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_auditlog_api.py 99.63% ⭐ 98.79% ⭐ -0.84% 👎
test/test_authproxy_setting.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_bool_config_item.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_chart_metadata.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_chart_version.py 95.94% ⭐ 99.75% ⭐ 3.81% 👍
test/test_component_health_status.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_configurations.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_configurations_response.py 93.48% ⭐ 99.75% ⭐ 6.27% 👍
test/test_cve_allowlist.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_cve_allowlist_item.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_error.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_errors.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_execution.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_extra_attrs.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_filter_style.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_gc_api.py 99.83% ⭐ 99.52% ⭐ -0.31% 👎
test/test_gc_history.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_general_info.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_icon.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_icon_api.py 99.63% ⭐ 98.79% ⭐ -0.84% 👎
test/test_immutable_api.py 99.79% ⭐ 99.31% ⭐ -0.48% 👎
test/test_immutable_rule.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_immutable_selector.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_instance.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_integer_config_item.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_is_default.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_label.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_label_api.py 99.75% ⭐ 99.40% ⭐ -0.35% 👎
test/test_ldap_api.py 99.79% ⭐ 99.31% ⭐ -0.48% 👎
test/test_ldap_conf.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_ldap_failed_import_user.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_ldap_import_users.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_ldap_ping_result.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_ldap_user.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_metadata.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_metrics.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_native_report_summary.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_oidc_api.py 99.63% ⭐ 98.79% ⭐ -0.84% 👎
test/test_overall_health_status.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_permission.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_ping_api.py 99.63% ⭐ 98.79% ⭐ -0.84% 👎
test/test_platform.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_preheat_api.py 99.93% ⭐ 99.78% ⭐ -0.15% 👎
test/test_preheat_policy.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_project.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_project_api.py 99.90% ⭐ 99.68% ⭐ -0.22% 👎
test/test_project_deletable.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_project_member.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_project_member_entity.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_project_metadata.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_project_req.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_project_scanner.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_project_summary.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_project_summary_quota.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_provider_under_project.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_quota.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_quota_api.py 99.75% ⭐ 99.20% ⭐ -0.55% 👎
test/test_quota_ref_object.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_quota_update_req.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_reference.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_registry.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_registry_api.py 99.88% ⭐ 99.60% ⭐ -0.28% 👎
test/test_registry_credential.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_registry_endpoint.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_registry_info.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_registry_ping.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_registry_provider_credential_pattern.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_registry_provider_endpoint_pattern.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_registry_provider_info.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_registry_update.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_replication_api.py 99.89% ⭐ 99.66% ⭐ -0.23% 👎
test/test_replication_execution.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_replication_filter.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_replication_policy.py 95.94% ⭐ 99.75% ⭐ 3.81% 👍
test/test_replication_task.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_replication_trigger.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_replication_trigger_settings.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_repository.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_repository_api.py 99.79% ⭐ 99.40% ⭐ -0.39% 👎
test/test_resource_list.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_retention_api.py 99.88% ⭐ 99.63% ⭐ -0.25% 👎
test/test_retention_execution.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_retention_execution_task.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_retention_metadata.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_retention_policy.py 95.94% ⭐ 99.75% ⭐ 3.81% 👍
test/test_retention_policy_scope.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_retention_rule.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_retention_rule_metadata.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_retention_rule_param_metadata.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_retention_rule_trigger.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_retention_selector.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_retention_selector_metadata.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_robot.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_robot_api.py 99.83% ⭐ 99.46% ⭐ -0.37% 👎
test/test_robot_create.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_robot_create_v1.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_robot_created.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_robot_permission.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_robot_sec.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_robotv1_api.py 99.81% ⭐ 99.40% ⭐ -0.41% 👎
test/test_role_request.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_scan_all_api.py 99.81% ⭐ 99.46% ⭐ -0.35% 👎
test/test_scan_api.py 99.70% ⭐ 99.20% ⭐ -0.50% 👎
test/test_scan_overview.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_scanner.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_scanner_adapter_metadata.py 97.95% ⭐ 99.75% ⭐ 1.80% 👍
test/test_scanner_api.py 99.86% ⭐ 99.56% ⭐ -0.30% 👎
test/test_scanner_capability.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_scanner_registration.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_scanner_registration_req.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_scanner_registration_settings.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_schedule.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_schedule_obj.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_search.py 95.94% ⭐ 99.75% ⭐ 3.81% 👍
test/test_search_api.py 99.63% ⭐ 98.79% ⭐ -0.84% 👎
test/test_search_repository.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_search_result.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_start_replication_execution.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_stats.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_storage.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_string_config_item.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_supported_webhook_event_types.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_system_cve_allowlist_api.py 99.70% ⭐ 99.03% ⭐ -0.67% 👎
test/test_system_info.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_systeminfo_api.py 99.75% ⭐ 99.20% ⭐ -0.55% 👎
test/test_tag.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_task.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_user_entity.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_user_group.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_user_profile.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_user_search.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_vulnerability_summary.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_webhook_api.py 99.85% ⭐ 99.52% ⭐ -0.33% 👎
test/test_webhook_job.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_webhook_last_trigger.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_webhook_policy.py 99.32% ⭐ 99.75% ⭐ 0.43% 👍
test/test_webhook_target_object.py 99.75% ⭐ 99.75% ⭐ 0.00%
test/test_webhookjob_api.py 99.63% ⭐ 98.79% ⭐ -0.84% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@sonarcloud
Copy link

sonarcloud bot commented Jan 30, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 349 Code Smells

No Coverage information No Coverage information
54.7% 54.7% Duplication

@alexandre-k alexandre-k merged commit 1aafbbd into master Jan 30, 2023
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.

None yet

1 participant