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

Investigate the remaining issues with pipeline schema from BB #21

Open
sdzh-atlassian opened this issue Dec 10, 2024 · 3 comments
Open
Labels
bitbucket This is related to Bitbucket triaged Someone from @atlassian/axon looked into this

Comments

@sdzh-atlassian
Copy link
Member

sdzh-atlassian commented Dec 10, 2024

Hello team @atlassian/axon!

I'm resolving some BB issues and decided to move this one here

We might want to investigate if it would be possible to:

  1. Point the bitbucket-pipelines.yaml schema to the web instead of distributing a copy
  2. Not nuke the settings on extension reinstall? (if that still happens)

This issue is prompted by 2 related issues from our old BB repo:

Edit - more related BB issues:

@detouched
Copy link
Member

Hey @sdzh-atlassian 👋

It's safe to use the official schema, and just copying it is enough to close the gap for VS Code support of pipelines. However, in the long run I believe we need some kind of update mechanism cause we, Pipelines, keep adding features, and the schema gets updated from time to time.

The way I implemented this for IntelliJ plugin is as follows:

  • fetch the latest official schema on build and bundle it in the distro
  • once the plugin is loaded, copy the bundled schema into user app settings, unless there's an existing schema there (which might be newer – this can be improved if we start versioning our schema properly)
  • every now and then fetch the official schema and replace the schema in user app settings in case they differ

This means there will be a recent version of the schema no matter whether the user is currently online or not, including the very first use of the plugin. I'm not claiming this to be the best mechanism though 😁

@sdzh-atlassian
Copy link
Member Author

Got it, thank you very much for the explanation @detouched! Fetching the schema on the build is exactly what I had in mind, too ;)

Alternatively, maybe vscode will just let us refer to the endpoint serving the schema directly, without downloading it? 🤔

We'll see what we can do on our side, thanks again! :)

@sdzh-atlassian sdzh-atlassian added triaged Someone from @atlassian/axon looked into this bitbucket This is related to Bitbucket labels Dec 11, 2024
@sdzh-atlassian
Copy link
Member Author

Hello again @detouched! :)

I've briefly looked into this issue a bit more, and wanted to share a fun bit of info I discovered. Apparently, if we completely remove all references to this schema file from the extension - VSCode's YAML extension will just default to using your schema from here

image

Since the one bit of tension with settings I could reproduce had to do with the schema settings being overwritten:

image

I was wondering if we could just completely nuke it, and use that default mechanism instead 🤔 This notably doesn't work offline - but might help address the remote path issues folks are reporting here and to us.

Funnily enough, I could narrow down to the fact that the schema is provided by the yaml extension - but couldn't just yet figure out where it's coming from, there xD I've also noticed that these two schemas seem to be identical:

Do you know what's the direction of the updates here? Are you pulling from https://api.bitbucket.org/schemas/pipelines-configuration periodically in that repo, or is it the other way around, and BB is just serving your schema?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bitbucket This is related to Bitbucket triaged Someone from @atlassian/axon looked into this
Projects
None yet
Development

No branches or pull requests

2 participants