Skip to content

OSD-27703: fix: Improve output for service and manager flags in login command#592

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
devppratik:export-hcp-env-vars
Jan 20, 2025
Merged

OSD-27703: fix: Improve output for service and manager flags in login command#592
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
devppratik:export-hcp-env-vars

Conversation

@devppratik
Copy link
Copy Markdown
Contributor

@devppratik devppratik commented Jan 19, 2025

What type of PR is this?

feature

What this PR does / Why we need it?

Which Jira/Github issue(s) does this PR fix?

  • The PR improves the output message for service and manager flags for the login command. It provides user to directly export the related variables. For service flag, there was no output related to the namespace or manifestwork which has been added now

  • The error message for login has been updated to clarify either management cluster or hive shard accordingly

Output

❯ go run ./cmd/ocm-backplane login $ID --service
A list of associated manifestwork for your given cluster can be found using:
	 oc get manifestworks -n <> -l api.openshift.com/id=$ID

The MC Namespace for the cluster can be exported using:
	export MC_NAME=<>

❯ go run ./cmd/ocm-backplane login $ID --manager
Execute the following command to export the list of associated namespaces for your given cluster
	export HIVE_NS=uhc-production-$ID

Note - I have hidden actual IDs from the output

Resolves OSD-27703

Special notes for your reviewer

Unit Test Coverage

Guidelines

  • If it's a new sub-command or new function to an existing sub-command, please cover at least 50% of the code
  • If it's a bug fix for an existing sub-command, please cover 70% of the code

Test coverage checks

  • Added unit tests
  • Created jira card to add unit test
  • This PR may not need unit tests

Pre-checks (if applicable)

  • Ran unit tests locally
  • Validated the changes in a cluster
  • Included documentation changes with PR

@devppratik devppratik changed the title fix: Improve output for service and manager flags in login command OSD-27703: fix: Improve output for service and manager flags in login command Jan 19, 2025
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jan 19, 2025

@devppratik: This pull request references OSD-27703 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set.

Details

In response to this:

What type of PR is this?

feature

What this PR does / Why we need it?

Which Jira/Github issue(s) does this PR fix?

The PR improves the output message for service and manager flags for the login command. It provides user to directly export the related variables. For service flag, there was no output related to the namespace or manifestwork which has been added now

Output

❯ go run ./cmd/ocm-backplane login $ID --service
A list of associated manifestwork for your given cluster can be found using:
   oc get manifestworks -n <> -l api.openshift.com/id=$ID

The MC Namespace for the cluster can be exported using:
  export MC_NAME=<>

❯ go run ./cmd/ocm-backplane login $ID --manager
Execute the following command to export the list of associated namespaces for your given cluster
  export HIVE_NS=uhc-production-$ID

Note - I have hidden actual IDs from the output

Resolves OSD-27703

Special notes for your reviewer

Unit Test Coverage

Guidelines

  • If it's a new sub-command or new function to an existing sub-command, please cover at least 50% of the code
  • If it's a bug fix for an existing sub-command, please cover 70% of the code

Test coverage checks

  • Added unit tests
  • Created jira card to add unit test
  • This PR may not need unit tests

Pre-checks (if applicable)

  • Ran unit tests locally
  • Validated the changes in a cluster
  • Included documentation changes with PR

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 19, 2025
@devppratik
Copy link
Copy Markdown
Contributor Author

/test test
/test coverage

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jan 19, 2025

@devppratik: This pull request references OSD-27703 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set.

Details

In response to this:

What type of PR is this?

feature

What this PR does / Why we need it?

Which Jira/Github issue(s) does this PR fix?

  • The PR improves the output message for service and manager flags for the login command. It provides user to directly export the related variables. For service flag, there was no output related to the namespace or manifestwork which has been added now

  • The error message for login has been updated to clarify either management cluster or hive shard accordingly

Output

❯ go run ./cmd/ocm-backplane login $ID --service
A list of associated manifestwork for your given cluster can be found using:
   oc get manifestworks -n <> -l api.openshift.com/id=$ID

The MC Namespace for the cluster can be exported using:
  export MC_NAME=<>

❯ go run ./cmd/ocm-backplane login $ID --manager
Execute the following command to export the list of associated namespaces for your given cluster
  export HIVE_NS=uhc-production-$ID

Note - I have hidden actual IDs from the output

Resolves OSD-27703

Special notes for your reviewer

Unit Test Coverage

Guidelines

  • If it's a new sub-command or new function to an existing sub-command, please cover at least 50% of the code
  • If it's a bug fix for an existing sub-command, please cover 70% of the code

Test coverage checks

  • Added unit tests
  • Created jira card to add unit test
  • This PR may not need unit tests

Pre-checks (if applicable)

  • Ran unit tests locally
  • Validated the changes in a cluster
  • Included documentation changes with PR

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@devppratik
Copy link
Copy Markdown
Contributor Author

/test test

Comment thread cmd/ocm-backplane/login/login.go Outdated
Update Test cases

Update Return value for test case

Update Arg type for test file

Fix Test Cases and apply suggestion
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 20, 2025

@devppratik: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 20, 2025

Codecov Report

❌ Patch coverage is 51.51515% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.81%. Comparing base (9fbee9a) to head (9b41d09).
⚠️ Report is 435 commits behind head on main.

Files with missing lines Patch % Lines
cmd/ocm-backplane/login/login.go 68.00% 6 Missing and 2 partials ⚠️
pkg/ocm/ocmWrapper.go 0.00% 8 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
- Coverage   45.82%   45.81%   -0.01%     
==========================================
  Files          86       86              
  Lines        6726     6742      +16     
==========================================
+ Hits         3082     3089       +7     
- Misses       3267     3274       +7     
- Partials      377      379       +2     
Files with missing lines Coverage Δ
cmd/ocm-backplane/login/login.go 68.56% <68.00%> (-0.16%) ⬇️
pkg/ocm/ocmWrapper.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bmeng
Copy link
Copy Markdown
Contributor

bmeng commented Jan 20, 2025

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bmeng, devppratik

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 20, 2025
@openshift-merge-bot openshift-merge-bot Bot merged commit 3d36718 into openshift:main Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants