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

Can't use remote style on Azure DevOps #640

Open
pabepadu opened this issue Nov 22, 2023 · 0 comments
Open

Can't use remote style on Azure DevOps #640

pabepadu opened this issue Nov 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@pabepadu
Copy link

pabepadu commented Nov 22, 2023

Expected behavior

I would like to use a nitpick remote style on Azure DevOps.

The only way to get a raw file on Azure DevOps is to call APIs: https://learn.microsoft.com/en-us/rest/api/azure/devops/build/source-providers/get-file-contents?view=azure-devops-rest-7.1

This gives this kind of URL with the file path in the arguments: https://dev.azure.com/my_org/my_project/_apis/sourceProviders/Git/filecontents?repository=my_repository&path=nitpick/my_style.toml&api-version=7.1-preview.1

Current behavior

I get the below error because the last segment of the path don't have a .toml extension, then add it after filecontents:

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://dev.azure.com/my_org/my_project/_apis/sourceProviders/Git/filecontents.toml?repository=my_repository&path=nitpick%2Fmy_style.toml&api-version=7.1-preview.1

Part of the code for the tested version is here: https://github.com/andreoliwa/nitpick/blob/2148c86354dcb43545bcf2535803ce15384a7064/src/nitpick/style/fetchers/base.py#L42C13-L42C79

Steps to reproduce

  1. Set the below configuration:
    [tool.nitpick]
    style = "https://dev.azure.com/my_org/my_project/_apis/sourceProviders/Git/filecontents?repository=my_repository&path=nitpick/my_style.toml&api-version=7.1-preview.1"
    
  2. Run: nitpick ls

Possible Solution

Option to not normalize the url or have a specific configuration for Azure DevOps

Context

I want to use a remote nitpick style file on Azure DevOps.

Your environment

  • nitpick version used: 0.34.0
@pabepadu pabepadu added the bug Something isn't working label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Upvoted / Requests
Development

No branches or pull requests

1 participant