Skip to content

2495 Cannot use gitlens+ feature on public repo in some folders#2510

Merged
ramin-t merged 5 commits intomainfrom
bugs/2495-cannot-use-gitlens-feature-on-publi
Mar 10, 2023
Merged

2495 Cannot use gitlens+ feature on public repo in some folders#2510
ramin-t merged 5 commits intomainfrom
bugs/2495-cannot-use-gitlens-feature-on-publi

Conversation

@ramin-t
Copy link
Contributor

@ramin-t ramin-t commented Feb 17, 2023

Fixes: #2495

  • Stores a cache of repo visibility that lives longer than the per-session cache
  • Adds commands to reset the cache, either for open repos or for all repos

}

async visibility(repoPath: string): Promise<RepositoryVisibility> {
async visibility(repoPath: string): Promise<[RepositoryVisibility, string | undefined]> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note on why this needed to be updated (for this and the GitHub provider): we need a hash of the remote id or remote ids that are "responsible" for the visibility of the repo (if public, the id of the remote that made it public, if private, the id of all the remotes, and if local, none).

This hash is returned back along with the visibility so that we can include it in the cache. Then whenever we access from cache, or the repo's remotes get updated, we can check the remotes against the hashed value and bust the cache if it changed (doesn't apply to local repos, in which case we don't need to cache).

@ramin-t ramin-t force-pushed the bugs/2495-cannot-use-gitlens-feature-on-publi branch from 5964e85 to bcfa746 Compare March 6, 2023 17:35
@ramin-t ramin-t force-pushed the bugs/2495-cannot-use-gitlens-feature-on-publi branch from 9f56a5e to 6322242 Compare March 7, 2023 20:33
@d13
Copy link
Member

d13 commented Mar 10, 2023

LGTM, just needs a rebase 🚀

@ramin-t ramin-t force-pushed the bugs/2495-cannot-use-gitlens-feature-on-publi branch from 6322242 to 00456e1 Compare March 10, 2023 16:27
@ramin-t ramin-t merged commit ee5c175 into main Mar 10, 2023
@ramin-t ramin-t deleted the bugs/2495-cannot-use-gitlens-feature-on-publi branch March 10, 2023 16:37
@maj113
Copy link

maj113 commented Jul 15, 2023

I'm having the same issue as #2495 can't comment there, public repo treated as a private one;

2023-07-15 20:58:11.348] [GIT  ] [c:/Users/maj/Documents/Repo/Angel6] git remote -v [116ms]
[2023-07-15 20:58:11.348] [   b1] GitRemoteParser.parse completed [0ms]
[2023-07-15 20:58:11.348] [   b0] LocalGitProvider.getRemotes(e=c:/Users/maj/Documents/Repo/Angel6) completed [116ms]
[2023-07-15 20:58:11.348] [   b2] GitProviderService.getVisibilityInfoFromCache(e=c:/Users/maj/Documents/Repo/Angel6)
[2023-07-15 20:58:11.348] [   b2] GitProviderService.getVisibilityInfoFromCache(e=c:/Users/maj/Documents/Repo/Angel6) returned private [0ms]
[2023-07-15 20:58:11.348] [   af] GitProviderService.visibilityCore returned private [116ms]
[2023-07-15 20:58:11.348] [   ae] GitProviderService.visibility returned private [116ms]

EDIT: @command:gitlens.plus.resetRepositoryAccess fixed it

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.

Cannot use gitlens+ feature on public repo in some folders

4 participants