cribeiro84 / azure-devops-pull-request-hub

Azure DevOps Pull Request Manager Hub
MIT License
59 stars 35 forks source link

[Bug] On premise error `Ensure that the effective permissions are included in shared data.` #180

Closed Herve-M closed 3 years ago

Herve-M commented 3 years ago

Describe the bug After installing the extension, going to the hub show nothing. Only Projects list is fetched correctly, Repositories is empty.

To Reproduce Steps to reproduce the behavior:

  1. Install the extension
  2. Go to Pull Request Manager Hub
  3. See error

Expected behavior List of PRs.

Screenshots (won't really help) image

Desktop:

Azure DevOps

Additional context Console logs:

cribeiro84 commented 3 years ago

Hi @Herve-M Do you have any disabled repo? If so, try to Re-enable it again to check if the issues goes away. I've released this new version to fix this issue but it seems for OnPrem it didn't work. Please confirm if the above approach works.

Thanks a lot

hymccord commented 3 years ago

@cribeiro84 We are seeing the same issue this morning. When you say disabled repo, you mean any project that has this feature disabled? image

We do have one project with that flag disabled. I re-enabled it but it didn't have any effect on the issue.

agileramblings commented 3 years ago

We are also having the same issue this morning. There is no way to roll back to a previous version of the extension either, so we have currently uninstalled this extension. :(

cribeiro84 commented 3 years ago

It's not clear for me what's the error itself. Those errors you mentioned seems to be an issue to load resources that drives me to an assumption of browser cache. Would you be able to clear the cache of your browser or try with Private Tab? If you could provide more details (if exists) in the console tab from your developer tools (F12) window would be great.

cribeiro84 commented 3 years ago

@cribeiro84 We are seeing the same issue this morning. When you say disabled repo, you mean any project that has this feature disabled? image

We do have one project with that flag disabled. I re-enabled it but it didn't have any effect on the issue.

About this disabled repo, I meant in the Repositories management where you can disable an individual repo, like:

image

agileramblings commented 3 years ago

@cribeiro84 You cannot disable repositories on-prem. (At least I cannot find a way)

image

Using Private Window in Firefox has no effect on the outcome.

image

Some PRs are listed in the PR tab

image

agileramblings commented 3 years ago

@cribeiro84 Repositories list in the filter is empty

image

cribeiro84 commented 3 years ago

Thanks for sharing more details. Would you be able to take a screenshot or to capture the console log entries (errors and logs)? Unfortunately, I don't have an OnPrem instance to test it.

agileramblings commented 3 years ago

image

cribeiro84 commented 3 years ago

@cribeiro84 Repositories list in the filter is empty

image

Is there a way for you to check on the Network tab the request to "Repositories" API? It should end like: /_apis/git/Repositories?includeLinks=true

agileramblings commented 3 years ago

image

hymccord commented 3 years ago

Is there a way for you to check on the Network tab the request to "Repositories" API? It should end like: /_apis/git/Repositories?includeLinks=true

The response looks good on my side too. The json contains all the repos of the currently selected projects in the filter. However, I'm unable to change the project filters. After clicking a checkbox or two, you get this in the console:

image

agileramblings commented 3 years ago

Our repository data is also present/listed in the 200 response from the GET /git/Repositories call.

agileramblings commented 3 years ago

image

cribeiro84 commented 3 years ago

I don't think the problem is this 404 object/error because the APIs are being called and it's getting the results. This asset error might be related to an image for No PRs screen which is not being found.

It's not clear why the result is not being well handled. Do you have more than 1 project within the same instance? If so, are you able to select different project?

agileramblings commented 3 years ago

We only have one active TeamProject (it is the only one with PRs) but we have 3 other TeamProjects in the TPC and they do show up in the Projects filter list.

cribeiro84 commented 3 years ago

Got it! Just one thing that came up to my mind. Can you check if in the response from Repositories API call if there is an attribute called "isDisabled" that should be equal to false? I indeed did a change in the last release that could've broken for you in case this attribute doesn't exist at all in OnPrem versions.

agileramblings commented 3 years ago

image There is a list of [object] that I've expanded one example of. Each [Object] seems to be a repository list item. There is no property on the list item of "isDisabled" that I can find.

hymccord commented 3 years ago

I'm not seeing the field either on my Azure DevOps Server 2020 RC2 environment.

image

Here's the response from my personal Azure Devops Services

image

cribeiro84 commented 3 years ago

I just released a new version with a possible fix. Can you try again to use the extension?

agileramblings commented 3 years ago

image

:( From Private Browser window in Firefox

image

cribeiro84 commented 3 years ago

Would you be able to fork/checkout this repo and debug from your OnPrem instance? I can assign you to a dev/test extension I have for development purposes to allow you to debug it. I would need your account/org name.

Herve-M commented 3 years ago

@cribeiro84 Sadly as agileramblings said, OnPremise don't have the feature of disabling a repository yet.

Questions:

About sharing our org. to be able to share a dev. build, for On Premise not behind dev.azure.com it won't be possible. Only way will be to share the package :/

hymccord commented 3 years ago

I got it debugging. Your instructions in the README were very helpful :+1:

No dice: image

With filter commented out (this works) image

Did a git bisect 78bb434 origin/main just to make sure the bad commit was the isDisabled introduction and it is:

$ git bisect good
d7cdc2a7729ab02a2280b4be90ba618dc327db15 is the first bad commit
commit d7cdc2a7729ab02a2280b4be90ba618dc327db15
Author: Carlos Alessandro Ribeiro <cribeiro84@gmail.com>
Date:   Fri Apr 2 20:35:05 2021 -0300

    Bugfix/ignore disabled repos (#178)

    * Fixing isDisabled repos

    * trying to fix dependency tree

    * Fix for unselected proejcts on load PR manager without filter.

    * Trying to fix broken links

    Co-authored-by: Carlos Alessandro Ribeiro <carlos_alessandro@swissre.com>

 package-lock.json               | 32539 +++++++++++++++++++++++++++++++-------
 package.json                    |    12 +-
 src/models/PullRequestModel.tsx |     5 +
 src/tabs/PullRequestsTab.tsx    |   112 +-
 4 files changed, 26614 insertions(+), 6054 deletions(-)

Then I realized you just got your boolean logic bungled! On Server 2020, r.isDisabled !== undefined will always return false.

We want to keep all repos where the property is undefined or not disabled. If the API ever starts returning it, then it'll be fine.

const repos = (await this.gitClient.getRepositories(projectId, true) as GitRepositoryModel[]).filter(r => r.isDisabled === undefined || r.isDisabled === false);

Voila image

See my PR!

Feel free to edit as you see. I know the change to the GitRepositoryModel interface wasn't necessary. I'm not a typescript person but I know it has to do with strict null checking if you turn that on.

cribeiro84 commented 3 years ago

Thanks @InKahootz for the PR! It has been released and hopefully it's now fixed! Thank you so much for the contribution!

Herve-M commented 3 years ago

@cribeiro84 / @InKahootz Still have the issue with the last update, 2.20210405.1 :/

hymccord commented 3 years ago

That's an older version, or at least is should be. 2.20210405.1 is for commit efa6a6a.

The latest is 2.20210406.1. Might take a little bit to show up but the pipeline showing that it was built and pushed is here: https://dev.azure.com/caixaazul/Pull%20Request%20Manager%20Hub/_build/results?buildId=226&view=results

Edit: I can confirm it's working on my projects. The "No PRs" image is not working but that's not a deal-breaker/another issue. image

agileramblings commented 3 years ago

It is working now guys! Great work!! Thanks for a great extension @cribeiro84

image

cribeiro84 commented 3 years ago

Amazing! Thank all of you for raising the issues and PR! Thanks @InKahootz for the contribution

Don't forget to rate the extension in the marketplace that helps to get more contributions ;-)

sunnynagavo commented 3 years ago

i am facing same problem again,