Skip to content

[Spec] Auto generate manifests for newer versions #236105

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

vedantmgoyal9
Copy link
Contributor

@vedantmgoyal9 vedantmgoyal9 commented Mar 9, 2025

I've drafted a spec on how Winget automation could work based on what I’ve built so far, but the field names and other details may need a complete overhaul. Suggestions and feedback are more than welcome!

cc @denelon @stephengillie @Trenly @ImJoakim @ItzLevvie @jedieaston @KaranKad @mdanish-kh @OfficialEsco @quhxl @russellbanks @SpecterShell @PckgrBot

@wingetbot
Copy link
Collaborator

Service Badge  Service Badge  

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Attention This work item needs to be reviewed by a member of the core team. label Mar 9, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Attention This work item needs to be reviewed by a member of the core team. label Mar 20, 2025
The automation consists of a PowerShell script that:

1. Loads variables specified in the `AdditionalInfo` object.
2. Executes `Invoke-RestMethod` or `Invoke-WebRequest` with the defined arguments (supporting multiple sources for different APIs).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would software from RSS feeds be handled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephengillie
Copy link
Collaborator

@wingetbot run

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Attention This work item needs to be reviewed by a member of the core team. label Mar 27, 2025
Copy link
Contributor

@Trenly Trenly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have detail in here about what the schema looks like, but there isn't anything describing the function of the application itself.

You mention that it runs on a set schedule, how often does it run? Is that something which is configurable per package? Is the application something where a package update can triggered by a user making an API call or will it only operate on the schedule?

Not all of the fields are described in the specification either.
What does the Skip field do? How and when should it be set? Is Reason required, or optional? Is there any length constraints? Any Regex validation? Are any of the fields in the specification enums?

Another consideration - how long should scripts be? How are they validated? Is there a maximum length? Maybe it makes more sense to have the script be a separate file in the same directory as the auto-update metadata, that way PSScriptAnalyzer can be run on it. Should the script be something like the format of a DSC resource where there is a Get, a Set, and a Test method (or something similar) where there is /a function specifying how to Get the URLS, a Set function for specifying how to call wingetcreate, and a Test method for checking the manifest is valid and performing any other needed updates before submission?

This is a good start, but I think it needs a lot more thought and detail around implementation.

}
```

The above JSON defines automation metadata and will be stored in a `.auto_updates.json` file alongside `.validation` files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be better to have a separate directory structure specifically for auto-updates instead of including metadata in the manifests folder. While having the data right next to all of the manifests makes it easy for users to find, it greatly increases the complexity cost of a solution since whatever is built will have to recursively filter through all the directories to find the metadata files instead of filtering to only a known sub-tree

2. Executes `Invoke-RestMethod` or `Invoke-WebRequest` with the defined arguments (supporting multiple sources for different APIs).
3. Runs the `PostResponseScript` to process API responses.
4. Calls `wingetcreate update` in non-interactive mode:
- Uses `--submit` if no additional metadata is required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these cases, wouldn't it be better to have the ISV's integrate wingetcreate into their CI/CD pipeline? My worry would be that if an official automation is added, publishers would just do nothing and let the automation handle it instead of supporting their own applications.

While polling for a new version works at small scale, it can easily chew up a ton of bandwidth. There are currently ~8,000 package identifiers in the repository; If even 20% of them were polled, that would be 1,600 packages every few hours that need to be queried for updates, and that will only grow as the service grows.

If the manifest is simple enough that wingetcreate update --submit can handle it, then it is trivial for an ISV to integrate wingetcreate into their CI/CD process - turning the flow from a pull to a push


## Security

Security remains unaffected. PRs generated by the automation will go through the same validation pipelines and require manual moderator approval before merging.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If scripts are being added to the repository, the scripts will need to be validated somehow to ensure they are safe. There are security implications to running scripts in an automated environment - for example, what if the script tries to leak some process information that could contain secrets?


## Security

Security remains unaffected. PRs generated by the automation will go through the same validation pipelines and require manual moderator approval before merging.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, how are the endpoints that are being called validated for security? It wouldn't be good to have an azure agent talking to a URL that is MitM'ing all the traffic over to a threat actor, just to try and get information about Package Update.

Do domains need to be tested and whitelisted? Does there need to be some form of SmartScreen trust level check?


## Potential Issues

- **GitHub API Rate Limits**: Applications distributed via GitHub Releases may face API rate limits. Encouraging project maintainers to directly update WinGet manifests (push-style automation) could help mitigate this issue.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not just GitHub API Rate Limits, but what about other sites that have rate limits such as Mozilla? If they get hit with a few hundred requests quickly enough, they could throttle the connections or toss back 403 or 429 error


## Potential Issues

- **GitHub API Rate Limits**: Applications distributed via GitHub Releases may face API rate limits. Encouraging project maintainers to directly update WinGet manifests (push-style automation) could help mitigate this issue.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a publisher removes their API or blocks the user agent or changes the response or the ISV changes the format of the file name? How do downstream breaking changes get surfaced to the repo here? It wouldn't be good to have bad PRs being submitted, but it also wouldn't be good to fail silently


## Future Considerations

- Expanding automation to support distribution methods other than GitHub Releases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this already covered by the schema above, where any endpoint can be used?


This PowerShell script will be executed in an Azure Pipeline on a set schedule.

## UI/UX Design
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the UI / UX of the PRs that are submitted using the automation? Do they appear as normal PRs? Is there something linking them to the automation run? Are there any logs that are generated?


Security remains unaffected. PRs generated by the automation will go through the same validation pipelines and require manual moderator approval before merging.

## Compatibility
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the expected "correctness" of the automation? One thing that comes to mind is the request to be able to push changes onto wingetbot PRs since it isn't always accurate - this would likely have the same issue where if something was inaccurate the PR would have to be either merged or closed and a second PR would have to be opened to address it (as well as potentially a third to actually fix the script)

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Attention This work item needs to be reviewed by a member of the core team. label May 2, 2025
@stephengillie
Copy link
Collaborator

@wingetbot run

@stephengillie
Copy link
Collaborator

@wingetbot run

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention This work item needs to be reviewed by a member of the core team. Project-File and removed Project-File labels May 8, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Attention This work item needs to be reviewed by a member of the core team. label May 9, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Moderator-Approved One of the Moderators has reviewed and approved this PR label May 27, 2025
Copy link
Contributor

@Trenly Trenly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking as needs changes based on my comments above, so that this doesn't get accidentally merged due to Levvie's approvals

@denelon
Copy link
Collaborator

denelon commented May 28, 2025

We definitely need the schema for these files to be explicitly built and included for JSON schema validation. We're also going to need similar documentation to what we have for manifests so authors can look at these files. There are also going to be extra concerns regarding folks submitting new files and attempting to modify them.


The proposed automation will automatically open pull requests (PRs) for new versions of applications when a new release is detected via the software’s API.

```jsonc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of JSON, could the manifests use YAML like app manifests? It would improve readability and simplify multi-line strings, but need an additional PowerShell module

@ItzLevvie
Copy link
Contributor

@wingetbot run

@microsoft-github-policy-service microsoft-github-policy-service bot removed Needs-Author-Feedback This needs a response from the author. Project-File labels Jun 4, 2025
@wingetbot
Copy link
Collaborator

Validation Pipeline Run WinGetSvc-Validation-63-236105-20250604-1

@microsoft-github-policy-service microsoft-github-policy-service bot added Project-File Needs-Attention This work item needs to be reviewed by a member of the core team. labels Jun 4, 2025
@wingetbot wingetbot added the PullRequest-Error PR is Invalid label Jun 4, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback This needs a response from the author. No-Recent-Activity No activity has occurred on this work item for seven days. labels Jun 4, 2025
@vedantmgoyal9 vedantmgoyal9 removed their assignment Jun 9, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed No-Recent-Activity No activity has occurred on this work item for seven days. Changes-Requested Changes Requested Moderator-Approved One of the Moderators has reviewed and approved this PR Needs-Attention This work item needs to be reviewed by a member of the core team. Needs-Author-Feedback This needs a response from the author. PullRequest-Error PR is Invalid labels Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants