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

Update readme to include section about the schema and Custom Schema File using a URL #517

Open
Dirkadin opened this issue Apr 10, 2023 · 3 comments

Comments

@Dirkadin
Copy link

Dirkadin commented Apr 10, 2023

After a lot of digging, it appears that there is a lot of confusion around where the schema the project uses comes from. Could I add to README.md, or another file linked to from README.md, to include an explanation of where the schema comes from and how it can not be modified? I'm not the first person to have gone through this adventure and I'm sure I won't be the last.

Topics to go over

  1. Where the schema is generated from and how it's not available for modification
  2. How get the schema from your organization
  3. How to use your own schema file

I tried to workaround this by giving the "Custom Schema File" setting a url to my own, but....

This
"https://raw.githubusercontent.com/Dirkadin/azure-pipelines-vscode/e23616c982f06e45e24065f5450447206f859255/service-schema.json"

Turns into this from the URI.parse() function in vscode-uri.
"/Dirkadin/azure-pipelines-vscode/e23616c982f06e45e24065f5450447206f859255/service-schema.json"

The root cause of this appears to be the regex used in vscode not accounting for sub domains.

I managed to set the value while debugging and confirm it works. Here is a variable template not getting yellow squiggly lines like it does in the current schema.
image

@KonstantinTyukalov
Copy link
Contributor

Hi @Dirkadin thanks for the reporting! We're working on higher priority issues at the moment, but we'll get back to this one soon.
If you already have some prepared documentation improvements, feel free to open a PR and we'll review it
Thanks!

@winstliu
Copy link
Member

Yeah, something that makes it clearer that the schema in this repo can't be modified would be a great improvement, because we commonly get PRs changing it that we sadly can't accept.

I tried to workaround this by giving the "Custom Schema File" setting a url to my own

So, supplying a URL is actually an undocumented feature that I added (before schema auto-detection was a thing) and am considering removing because of the extra complexity that it introduces: could you describe why you're trying to use this feature, and if the alternatives (auto-detection, using a local file) would be sufficient for your needs?

@Dirkadin
Copy link
Author

Dirkadin commented Apr 10, 2023

@KonstantinTyukalov @50Wliu , Thanks for the replies!

I'll try and get a PR up soon explaining what's going on with the schema.

@50Wliu
The idea behind wanting to supply a URL is to enable the community to have a shared schema that can be updated between
sprints. Also, in the nicest way possible, be more representative of what is and is not a valid pipeline yml file.

I did take some time to go through the implementation and it does add some extra complexity that doesn't need to be there. If I get some time this week, would you be open a PR to try and address that? Although it looks like making a change to vscode itself might be more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants