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

update rpkg commands to print to correct stream on execution #30

Merged
merged 10 commits into from
Mar 8, 2024

Conversation

kushnaidu
Copy link
Contributor

This change updates the rpkg commands to print to stdout on successful execution instead of stderr.

@nephio-prow nephio-prow bot requested review from efiacor and s3wong March 6, 2024 11:41
@kushnaidu
Copy link
Contributor Author

/hold
This PR is to get reviews from the community.

@liamfallon
Copy link
Member

liamfallon commented Mar 6, 2024

/hold This PR is to get reviews from the community.

@kushnaidu is this PR addressing Issue 562?

@kushnaidu
Copy link
Contributor Author

/hold This PR is to get reviews from the community.

@kushnaidu is this PR addressing Issue 562?

Hey @liamfallon, Yes, it is addressing nephio-project/nephio#562.

@efiacor
Copy link
Collaborator

efiacor commented Mar 7, 2024

Hi @kushnaidu ,
It looks like some of the cli tests will need to be updated.

https://github.com/nephio-project/porch/actions/runs/8171468957/job/22339752701?pr=30#step:9:87

https://github.com/nephio-project/porch/blob/main/test/e2e/cli/testdata/rpkg-clone/config.yaml#L61

To run locally, try to follow the setup done in the github action.

kind cluster running,
IMAGE_REPO=porch-kind IMAGE_TAG=testing make run-in-kind-kpt
E2E=1 go test -v -timeout 20m porch/test/e2e/cli

@kushnaidu
Copy link
Contributor Author

Hi @kushnaidu , It looks like some of the cli tests will need to be updated.

https://github.com/nephio-project/porch/actions/runs/8171468957/job/22339752701?pr=30#step:9:87

https://github.com/nephio-project/porch/blob/main/test/e2e/cli/testdata/rpkg-clone/config.yaml#L61

To run locally, try to follow the setup done in the github action.

kind cluster running, IMAGE_REPO=porch-kind IMAGE_TAG=testing make run-in-kind-kpt E2E=1 go test -v -timeout 20m porch/test/e2e/cli

Hey @efiacor,
Yup, after the code was updated to print to stdout, the unit tests are now complaining about unexpected output in stdout. I shall look into it.
Thanks

Signed-off-by: Kushal Harish Naidu <[email protected]>
Signed-off-by: Kushal Harish Naidu <[email protected]>
@kushnaidu
Copy link
Contributor Author

Hey @efiacor ,
I've now fixed the porch cli E2E tests.
Regards, Kushal.

@efiacor
Copy link
Collaborator

efiacor commented Mar 8, 2024

/lgtm
/approve

@nephio-prow nephio-prow bot added the lgtm label Mar 8, 2024
Copy link
Contributor

nephio-prow bot commented Mar 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: efiacor, kushnaidu

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

The pull request process is described here

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

@@ -163,6 +163,7 @@ func (r *runner) runE(cmd *cobra.Command, args []string) error {
r.printFnResult(result, printOpt)
}
}
fmt.Fprintf(cmd.OutOrStdout(), "%s pushed\n", packageName)
Copy link
Member

Choose a reason for hiding this comment

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

Could we put a similar message on 'pull'?

Copy link
Member

Choose a reason for hiding this comment

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

Could we put a similar message on 'pull'?

Never mind, pull already prints the manifests.

@kushnaidu
Copy link
Contributor Author

Hey @efiacor,
I think this PR is good to go. I will create another PR which shall introduce unit tests for these commands.
Regards,
Kushal

@nephio-prow nephio-prow bot merged commit d352343 into nephio-project:main Mar 8, 2024
6 checks passed
@efiacor efiacor deleted the rpkg-command-output branch March 8, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants