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

fix: HOME with different permissions #2361

Merged
merged 25 commits into from
Sep 9, 2024

Conversation

gauron99
Copy link
Contributor

@gauron99 gauron99 commented Jun 13, 2024

Make sure standard functionality works even when HOME has different permissions

  • added new tests
  • test for permissions that is skipped for windows and prow
  • print warning for not sufficient permissions when trying to access func config file (usually func/.config.yaml in $HOME)

/kind enhancement

@knative-prow knative-prow bot added kind/enhancement do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jun 13, 2024
Copy link

knative-prow bot commented Jun 13, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot requested a review from maximilien June 13, 2024 09:35
@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 13, 2024
@knative-prow knative-prow bot requested a review from vyasgun June 13, 2024 09:35
@knative-prow knative-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 13, 2024
@gauron99 gauron99 changed the title HOME with different permissions fix: HOME with different permissions Jun 13, 2024
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 67.10%. Comparing base (f4bd1d8) to head (1fbb2a8).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cmd/root.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2361      +/-   ##
==========================================
+ Coverage   61.54%   67.10%   +5.55%     
==========================================
  Files         129      129              
  Lines       15334    11931    -3403     
==========================================
- Hits         9437     8006    -1431     
+ Misses       4971     2962    -2009     
- Partials      926      963      +37     
Flag Coverage Δ
e2e-test 36.65% <66.66%> (-0.01%) ⬇️
e2e-test-oncluster 33.44% <66.66%> (+0.01%) ⬆️
e2e-test-oncluster-runtime 29.57% <66.66%> (?)
e2e-test-runtime-go 26.62% <66.66%> (?)
e2e-test-runtime-node 26.00% <66.66%> (?)
e2e-test-runtime-python 26.00% <66.66%> (?)
e2e-test-runtime-quarkus 26.10% <66.66%> (?)
e2e-test-runtime-rust 25.15% <66.66%> (?)
e2e-test-runtime-springboot 25.18% <66.66%> (?)
e2e-test-runtime-typescript 26.09% <66.66%> (?)
integration-tests 53.14% <50.00%> (+2.41%) ⬆️
unit-tests 51.28% <50.00%> (?)
unit-tests-macos-latest ?
unit-tests-ubuntu-latest ?
unit-tests-windows-latest ?

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gauron99
Copy link
Contributor Author

gauron99 commented Aug 8, 2024

/rerun all

@gauron99
Copy link
Contributor Author

gauron99 commented Aug 8, 2024

/test all

@gauron99
Copy link
Contributor Author

gauron99 commented Aug 8, 2024

/retest-required

pkg/config/config.go Outdated Show resolved Hide resolved
@gauron99 gauron99 marked this pull request as ready for review August 12, 2024 10:55
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 12, 2024
@knative-prow knative-prow bot requested review from rhuss and vyasgun August 12, 2024 10:55
@gauron99 gauron99 requested review from matejvasek and lkingland and removed request for rhuss and vyasgun August 12, 2024 10:55
@gauron99
Copy link
Contributor Author

/retest-required

Copy link
Member

@lkingland lkingland left a comment

Choose a reason for hiding this comment

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

/lgtm

/hold for potential squelching of the permission error

pkg/config/config.go Outdated Show resolved Hide resolved
@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 13, 2024
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2024
@gauron99
Copy link
Contributor Author

The main unit test is failing because "knative" user (GH actions/ something similar) has greater permissions, I suspect. Will have to update the new test.

@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 28, 2024
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
@gauron99
Copy link
Contributor Author

gauron99 commented Sep 9, 2024

@lkingland PTAL

I have moved the printing to the root.go file which significantly lowers the number of prints to just one per command.
I have also added a TODO for myself for the opportunity to simplify the whole process.

Copy link
Member

@lkingland lkingland left a comment

Choose a reason for hiding this comment

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

Looking good to me!

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 9, 2024
Copy link

knative-prow bot commented Sep 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99, lkingland

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

@gauron99
Copy link
Contributor Author

gauron99 commented Sep 9, 2024

/unhold

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 9, 2024
@knative-prow knative-prow bot merged commit 8dce9bc into knative:main Sep 9, 2024
39 checks passed
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. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants