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: dir no longer panics when HOME and XDG_CONFIG_HOME are not set (#449) #450

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

JeyJeyGao
Copy link
Contributor

@JeyJeyGao JeyJeyGao commented Sep 4, 2024

This PR addresses the issue #446 for release-1.1 branch
This commit was cherry picked from commit 4d76f9a

In this PR I:

  • I removed the init() function from dir/path
  • When userConfigDir() returns an error, instead of panic(err) I
    default to the current directory instead
  • Split loadUserPath() into two new functions used to setup and return
    the values for UserConfigDir and UserLibexecDir
  • Added additional unit tests for the two new functions and to test the
    default directory is used when HOME is set to ""

@JeyJeyGao JeyJeyGao changed the title fix: dir no longer panics when HOME and XDG_CONFIG_HOME are not set (#449) fix: dir no longer panics when HOME and XDG_CONFIG_HOME are not set (#449) for release-1.1 branch Sep 4, 2024
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.33%. Comparing base (0989bf5) to head (73b4bf6).
Report is 1 commits behind head on release-1.1.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-1.1     #450      +/-   ##
===============================================
+ Coverage        80.19%   80.33%   +0.13%     
===============================================
  Files               31       31              
  Lines             2101     2105       +4     
===============================================
+ Hits              1685     1691       +6     
+ Misses             288      287       -1     
+ Partials           128      127       -1     

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

Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

Instead of stating in the PR title, could you move for release-1.1 branch to the PR description?

And, please sign the commit.

@JeyJeyGao JeyJeyGao changed the title fix: dir no longer panics when HOME and XDG_CONFIG_HOME are not set (#449) for release-1.1 branch fix: dir no longer panics when HOME and XDG_CONFIG_HOME are not set (#449) Sep 4, 2024
@JeyJeyGao
Copy link
Contributor Author

Instead of stating in the PR title, could you move for release-1.1 branch to the PR description?

And, please sign the commit.

Updated

Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

I think the commit that's cherry picked is still not signed.

…otaryproject#449)

This PR addresses the issue notaryproject#446

In this PR I:

- I removed the `init()` function from `dir/path`
- When `userConfigDir()` returns an error, instead of `panic(err)` I
default to the current directory instead
- Split `loadUserPath()` into two new functions used to setup and return
the values for `UserConfigDir` and `UserLibexecDir`
- Added additional unit tests for the two new functions and to test the
default directory is used when `HOME` is set to `""`

---------

Signed-off-by: Jason <[email protected]>
Signed-off-by: JasonTheDeveloper <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Co-authored-by: Shiwei Zhang <[email protected]>
Co-authored-by: Patrick Zheng <[email protected]>
@JeyJeyGao
Copy link
Contributor Author

I think the commit that's cherry picked is still not signed.

Thanks. Updated.

Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

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

LGTM

@JeyJeyGao JeyJeyGao merged commit e6c7fef into notaryproject:release-1.1 Sep 5, 2024
9 checks passed
@JeyJeyGao JeyJeyGao mentioned this pull request Sep 5, 2024
6 tasks
JeyJeyGao added a commit that referenced this pull request Sep 9, 2024
## Release

This would mean tagging 595c710
`v1.1.2` to release.

## Vote

We need at least `4` approvals from `6` maintainers to release
`notation-go v1.1.2`.

- [x] Pritesh Bandi (@priteshbandi)
- [x] Junjie Gao (@JeyJeyGao)
- [ ] Rakesh Gariganti (@rgnote)
- [ ] Milind Gokarn (@gokarnm)
- [x] Shiwei Zhang (@shizhMSFT)
- [x] Patrick Zheng (@Two-Hearts)


## What's Changed
* fix&bump: maintenance update for branch `release-1.1` by @JeyJeyGao in
#448
* fix: dir no longer panics when HOME and XDG_CONFIG_HOME are not set
(#449) by @JeyJeyGao in
#450


**Full Changelog**:
v1.1.1...595c710

## Actions

Please review the PR and vote by approving.

Signed-off-by: Junjie Gao <[email protected]>
@JeyJeyGao JeyJeyGao mentioned this pull request Sep 9, 2024
6 tasks
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.

5 participants