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

Add additional metadata #4

Open
jessehouwing opened this issue Jan 10, 2023 · 17 comments
Open

Add additional metadata #4

jessehouwing opened this issue Jan 10, 2023 · 17 comments
Assignees

Comments

@jessehouwing
Copy link
Collaborator

jessehouwing commented Jan 10, 2023

Currently the metadata only contains the versions for each task, but it would be relatively simple to add:

  • Preview (isStable: false)
  • Deprecated
  • Repository.Uri (SourceUrl)
  • Marketplace Uri (Homepage)

Since all this data is available.

This would look something like this:

@JamieMagee @viceice What do you think and am I correct in guessing this would need to fit the ReleaseResult structure?

Would I need to add the metadata at the Release level, or can I just populate the repo and homepage data at the ReleaseResult level?

@jessehouwing jessehouwing self-assigned this Jan 10, 2023
@viceice
Copy link
Member

viceice commented Jan 11, 2023

normally it would be enough to have it on package level. but if it can change on different versions, it needs to be on the release.

i would prefer to have it on package level to reduce data size.

@jessehouwing
Copy link
Collaborator Author

jessehouwing commented Jan 12, 2023

I think I can normalize most tasks to have the metadata at the package level.

Some tasks however, have been forked or transferred to a different publisher, in which case the metadata would have changed at some point. The flutter task is an example of that. It started out from:

Then got forked and taken over by:

This means that while the taskname sometimes stays the same between these extensions, the taskid and longtaskname will be different between them. So the taskid and longtaskname would be straightforward and should be able to use the latest version metadata, the shortname can be problematic.

@viceice Can the SourceUrl or the Homepage be set at the package level and the only where it need to differ at the release level? Or, since this would be for older versions in almost all cases, simply follow the latest version?

eg:

    "flutter": {
      "sourceUrl": "https://github.com/Hey24Sheep/Flutter",
      "homepage": "https://marketplace.visualstudio.com/items?itemName=Hey24Sheep.Flutter"
      releases: [
         {
             "version":  "0.3.10"
         },
         ...
         ...
         {
             "version:"  "0.2.39"
             "sourceUrl": "https://github.com/aloisdeniel/Flutter"
         },
    }

@jessehouwing
Copy link
Collaborator Author

jessehouwing commented Jan 12, 2023

Here's a generated sample json file containing:

  • releaseTimeStamp
  • soucreUrl
  • homepage
  • isStable
  • isDeprecated
  • downloadUrl

This amounts to +- 50MB of json.

Without the downloadUrl it's about 20MB.

https://github.com/renovatebot/azure-devops-marketplace/tree/features/preview-and-deprecation

@viceice
Copy link
Member

viceice commented Jan 12, 2023

i think we don't need the download url

@viceice
Copy link
Member

viceice commented Jan 12, 2023

what about creating a JSON file per taskid and a meta file with mapping only. then the renovate datasources first fetches the metadata file and the taskid files on demand via GitHub CDN.

that way we don't need to update renovate to get newer data.

@jessehouwing
Copy link
Collaborator Author

Sure a possibility. We now have the data and can slice and dice it in any way you want :).

@viceice
Copy link
Member

viceice commented Jan 13, 2023

@JamieMagee @rarkins WDYT?

@jessehouwing
Copy link
Collaborator Author

jessehouwing commented Jan 13, 2023

An even better option would be to switch over top an API based approach, the TFS/Azure DevOps API has all the information needed for installed tasks:

On top of the data the server already knows, the marketplace data can help people find newer versions that weren't installed into their server.

For the built-in tasks it usually doesn't make much sense to report availability of versions the server doesn't have, since they only get updated through server upgrades or Microsoft's provisioning process and there isn't much an admin or user can do unless they go the "I'll install them myself route". I have a another project to give admins of Azure DevOps Server the ability to overwrite tasks:

@JamieMagee
Copy link
Contributor

@viceice I like that idea. We use GitHub pages as a JSON API.

@jessehouwing we can still implement the API-based datasource, and prefer it whenever Renovate is running in an Azure DevOps context. For the case where code is hosted in GitHub, but builds are run on Azure DevOps (this is the case for almost all the Microsoft org on GitHub for compliance reasons) we can use the cached data from this repo.

@jessehouwing
Copy link
Collaborator Author

I was thinking we could add additional config to make the API work even in a GitHub context. The Docs for configuring renovateme on Azure DevOps also show how to add GitHub configuration to generate release notes, this would be similar but the other way round.

Eg

--host-rules="[{\"domainName\":\"dev.rzure.com/myorg\",\"token\":\"$(AZURE_DEVOPS_TOKEN)\"}]"

@JamieMagee
Copy link
Contributor

Yeah, good point. That's another good way to provide an API token.

@jessehouwing
Copy link
Collaborator Author

So the idea is to generate a json file per identifier and stick the ReleaseRef object in that file, right? That should be relatively simple to do from where we are now.

@viceice
Copy link
Member

viceice commented Jan 24, 2023

yes please. than update the renovate datasource to fetch from github cdn instead of buildin big fat json.

@viceice
Copy link
Member

viceice commented Jan 24, 2023

I've created a feature issue on renovate side for required datasource changes.

@jessehouwing
Copy link
Collaborator Author

@jessehouwing
Copy link
Collaborator Author

There were a few illegal characters in the identifiers, I solved that with:

$identifier.ToLowerInvariant() -replace "[^a-z0-9_.-]", "_"

for now.

@jessehouwing
Copy link
Collaborator Author

@JamieMagee any news on the front-end implementation of this?

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

No branches or pull requests

4 participants
@JamieMagee @viceice @jessehouwing and others