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

Cache built-in tasks #12

Closed
JamieMagee opened this issue May 10, 2023 · 8 comments · Fixed by #13
Closed

Cache built-in tasks #12

JamieMagee opened this issue May 10, 2023 · 8 comments · Fixed by #13

Comments

@JamieMagee
Copy link
Contributor

This repository contains the data for Azure Pipelines tasks from the marketplace, but the built-in tasks data is still contained in the main Renovate repository. The built-in task data should also be generated here.

@jessehouwing
Copy link
Collaborator

I have a much simpler script that accomplishes the same thing without parsing the whole git history now.

This API call on an instance in Brazil will be the first to provide a list of all available versions of all built-in tasks in a single call:

https://github.com/jessehouwing/azure-pipelines-tasks-zips/blob/b686589c370a4b15cde73d5fd1fd8e2bc538d020/download.ps1#L9

$org = "jessehouwing-brazil"
$pat = $env:AZURE_DEVOPS_PAT

$url = "https://dev.azure.com/$org"
$header = @{authorization = "Basic $([Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(".:$pat")))"}

$tasks = Invoke-RestMethod -Uri "$url/_apis/distributedtask/tasks?allversions=true" -Method Get -ContentType "application/json" -Headers $header | ConvertFrom-Json -AsHashtable

$taskMetadatas = $tasks.value

It would also be more accurate, because the git repo contains task versions that ultimately weren't rolled out to the public or were rolled out weeks later.

@viceice
Copy link
Member

viceice commented May 17, 2023

can you open a PR to it to this repo?

@jessehouwing
Copy link
Collaborator

@viceice @JamieMagee That turned out even simpler than I expected. Pull request opened. I'll be out of office the upcoming days.

@jessehouwing
Copy link
Collaborator

jessehouwing commented May 17, 2023

Ah, crap. Did a compare and it looks like Microsoft has cleaned up all old tasks that contain old vulnerable implementations. Those used to be available in every org. Must have been my complaints about the security of the marketplace that's been driving a cleanup act, I had been asking very pointed questions about this directly to a number of PMs.

So there are many old versions missing from the data generated this way. As far as I can tell never a version you'd want to move to, but it's not an historically complete dataset.

Interestingly the github data isn't "correct" either. it lists many task versions that never made it to the public, but is also somehow missing a number of versions that are returned from the "live" azure devops org.

Left is the git parsed file, Right is the API call generated file:
image

The 219 versions are missing from the left hand side and 2.220.1 seems to not have been released, it has probably been patched on the release/m220 branch prior to rollout and shipped as 2.220.2.

Here are the files both normalized in the same way:
diffable files.zip

@jessehouwing
Copy link
Collaborator

This is in the end why it's probably better to finish the work to read directly from the Azure DevOps Organization of the user, instead of trying to build a cache file:

renovatebot/renovate#19725

@viceice
Copy link
Member

viceice commented May 19, 2023

yes, but until someone finished that we should move the cache file here and out of renovate repo.

@jessehouwing
Copy link
Collaborator

Bluiltin tasks are now also updated.

@viceice
Copy link
Member

viceice commented Jun 13, 2023

so next step is to fetch the new file on the fly from renovate datasource like we do for the marketplace.

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 a pull request may close this issue.

3 participants