-
Notifications
You must be signed in to change notification settings - Fork 59
Added how repo is selected section in README and other minor FAQs #49
Conversation
README.md
Outdated
@@ -97,6 +97,8 @@ EXAMPLES: | |||
|
|||
> ℹ️ There could be multiple caches in a repo with same key. This can happen when different caches with same key have been created for different branches. it may also happen if the `version` property of the cache is different which usually means that cache with same key was created for different OS or with different [paths](https://github.com/actions/cache#inputs). | |||
|
|||
## How Repo is selected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be put under a generic section for FAQ or troubleshooting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added under FAQs
README.md
Outdated
@@ -97,6 +97,8 @@ EXAMPLES: | |||
|
|||
> ℹ️ There could be multiple caches in a repo with same key. This can happen when different caches with same key have been created for different branches. it may also happen if the `version` property of the cache is different which usually means that cache with same key was created for different OS or with different [paths](https://github.com/actions/cache#inputs). | |||
|
|||
## How Repo is selected | |||
This extension currently uses the `go-gh` module's [`CurrentRepository` function](https://github.com/actions/gh-actions-cache/blob/d3293b69e1c5bc17686d815ab2c64618618c95df/internal/utils.go#L26) to determine the current repo. This function returns the first element of the list returned by the `git.Remotes()` internal function, which [sorts remotes such that `upstream` precedes `github`, which precedes `origin`](https://github.com/cli/go-gh/blob/c2fc965daac88a8a38dd8af02f236095b5dd48f1/internal/git/remote.go#L30). As such, if an `upstream` remote is present, this extension's default behavior is to return its caches. User's input `--repo <owner>/<name>` will override any current git repository and extension will fetch caches for the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my learning - what is special about upstream
and github
remotes. origin
is the default remote, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
origin
is the source for the current repo. So in case of forks origin
will point to the fork's origin
. In order to keep track between original and forked repo, we generally set a new remote upstream
to the original repo. Now we can use git fetch upstream
to sync forked and original repo. I am not sure about github
remote
README.md
Outdated
@@ -97,6 +97,8 @@ EXAMPLES: | |||
|
|||
> ℹ️ There could be multiple caches in a repo with same key. This can happen when different caches with same key have been created for different branches. it may also happen if the `version` property of the cache is different which usually means that cache with same key was created for different OS or with different [paths](https://github.com/actions/cache#inputs). | |||
|
|||
## How Repo is selected | |||
This extension currently uses the `go-gh` module's [`CurrentRepository` function](https://github.com/actions/gh-actions-cache/blob/d3293b69e1c5bc17686d815ab2c64618618c95df/internal/utils.go#L26) to determine the current repo. This function returns the first element of the list returned by the `git.Remotes()` internal function, which [sorts remotes such that `upstream` precedes `github`, which precedes `origin`](https://github.com/cli/go-gh/blob/c2fc965daac88a8a38dd8af02f236095b5dd48f1/internal/git/remote.go#L30). As such, if an `upstream` remote is present, this extension's default behavior is to return its caches. User's input `--repo <owner>/<name>` will override any current git repository and extension will fetch caches for the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User's input
--repo <owner>/<name>
will override any current git repository and extension will fetch caches for the same.
Is this sentence related to rest of paragraph? Or can be a separate para.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separated the line as next paragraph
Co-authored-by: Bishal Prasad <[email protected]>
What are you trying to accomplish?
Fix this issue #36
What approach did you choose and why?
Anything you want to highlight for special attention from reviewers?