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

Updating a manifest is only supported with the same number of installer URLs and some other errors not patched completely #236

Closed
gnpaone opened this issue Mar 10, 2022 · 12 comments

Comments

@gnpaone
Copy link

gnpaone commented Mar 10, 2022

Brief description of your issue

  1. Updating a manifest is only supported with the same number of installer URLs error occurred in previous version of wingetcreate and is said to be solved according to winget: fix asset/release regexes to match correctly git#475 but it's not solved in wingetcreate-self-contained.exe as you can see in winget log of https://github.com/gnpaone/MSEdgeRedirect/runs/5457611735?check_suite_focus=true (workflow used - https://github.com/gnpaone/MSEdgeRedirect/actions/runs/1948760855/workflow)
  2. Also force architecture is added according to Add architecture override option to Update command #206 but even that too not updated in wingetcreate-self-contained.exe as in winget log of https://github.com/gnpaone/MSEdgeRedirect/runs/5498146493?check_suite_focus=true (workflow used - https://github.com/gnpaone/MSEdgeRedirect/actions/runs/1963943160/workflow)

Actually I am trying to test submitting an app "using Github CI" to gnpaone/winget-pkgs instead of default microsoft/winget-pkgs by changing the settings of wingetcreate, but unfortunately (as tested in Windows 10 VM Powershell) the downloaded version of wingetcreate.exe gives not a self contained app error when ./wingetcreate.exe settings is ran (I ran that to find the path of settings.json file so that I can change the default submit repo to my repo using Github CI like this but due to that "not self contained app" error I am forced to use wingetcreate-self-contained.exe to find settings.json path) - finding path is via running wingetcreate settings and opening it in Notepad, click CTRL+Shift+S or Save As to reveal the default settings.json path created by wingetcreate

Steps to reproduce

1. https://github.com/gnpaone/MSEdgeRedirect/actions/runs/1948760855/workflow
2. https://github.com/gnpaone/MSEdgeRedirect/actions/runs/1963943160/workflow

Expected behavior

I expected it to update manifest/create PR in test repo flawlessly according to documentation. I basically just wanted to see how the --submit works.

Actual behavior

1. it gives Updating a manifest is only supported with the same number of installer URLs error
2. shows some syntax error as if the app isn't updated.

Environment

Windows Package Manager Manifest Creator v0.5.0.1 ([wingetcreate-self-contained.exe](https://github.com/microsoft/winget-create/releases/download/v0.5.0.1-preview/wingetcreate-self-contained.exe)) as shown in https://github.com/gnpaone/MSEdgeRedirect/runs/5498495223?check_suite_focus=true#step:3:23
@ghost ghost added the Needs-Triage label Mar 10, 2022
@ryfu-msft
Copy link
Contributor

ryfu-msft commented Mar 10, 2022

Hi @gnpaone,

Could you provide me the exact arguments used to execute the update command as well as a link to the existing manifests you were trying to update?

@gnpaone
Copy link
Author

gnpaone commented Mar 10, 2022

Hi @ryfu-msft, this is the manifest in my test repo - https://github.com/gnpaone/winget-pkgs/tree/master/manifests/r/rcmaehl/MSEdgeRedirect

  1. ./wingetcreate-self-contained.exe update -u $url64 $url -v $version -t "${{ secrets.MSEdgeRedirect_PAT }}" -s rcmaehl.MSEdgeRedirect
  2. ./wingetcreate-self-contained.exe update -u $url64|x64 $url|x86 -v $version -t "${{ secrets.MSEdgeRedirect_PAT }}" -s rcmaehl.MSEdgeRedirect

Also, I already have that GitHub secret in my repo settings

@ryfu-msft
Copy link
Contributor

Hi @ryfu-msft, this is the manifest in my test repo - https://github.com/gnpaone/winget-pkgs/tree/master/manifests/r/rcmaehl/MSEdgeRedirect

  1. ./wingetcreate-self-contained.exe update -u $url64 $url -v $version -t "${{ secrets.MSEdgeRedirect_PAT }}" -s rcmaehl.MSEdgeRedirect
  2. ./wingetcreate-self-contained.exe update -u $url64|x64 $url|x86 -v $version -t "${{ secrets.MSEdgeRedirect_PAT }}" -s rcmaehl.MSEdgeRedirect

Also, I already have that GitHub secret in my repo settings

So the errors that you're telling me about makes me think the two URLs you are providing are not getting parsed correctly. I would try enclosing each installerURL within a pair of parentheses each, just so that it is clear exactly the values you are providing to the tool.

For example:

./wingetcreate-self-contained.exe update -u "$url64|x64" "$url|x86" -v $version -t "${{ secrets.MSEdgeRedirect_PAT }}" -s rcmaehl.MSEdgeRedirect

Could you try that out and let me know if that worked for you?

@gnpaone
Copy link
Author

gnpaone commented Mar 10, 2022

https://github.com/gnpaone/MSEdgeRedirect/runs/5504156661?check_suite_focus=true so the overriding architecture worked, but still there's Updating a manifest is only supported with the same number of installer URLs error
But in https://github.com/gnpaone/MSEdgeRedirect/runs/5504156661?check_suite_focus=true#step:3:50 it says Overriding https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/ with architecture X64 but https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/ doesn't exist and the URL I given is https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/MSEdgeRedirect.exe in my workflow, any clarification on why that happened? 🤔

@ryfu-msft
Copy link
Contributor

ryfu-msft commented Mar 11, 2022

So looking at your script, there are a couple things I am noticing:

  1. You have a typo on line 3 where you wrote $filenam64 and it should be $filename64
  2. On line 4 and 5, I don't think you need the extra $ inside the curly braces, I believe it should be just:
$url="https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/${filename}"
$url64="https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/${filename64}"
  1. I would double check to make sure that your usage of string interpolation for your --u $url and $url64 are correct. I believe you need an enclosing "${url}|x64" around each url if you include them within quotations. Not 100% sure though so you'll need to check that.

Regarding the error message, the reason why Updating a manifest is only supported with the same number of installer URLs is showing up is because we don't allow duplicate installerUrls and only accept unique installerURLs. Since there is an issue with the urls you provided and both of them are shown as https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/, only one installerURL is showing up in the tool. We don't modify or change any of the installerURLs provided to the tool (except trimming), so I would add print statements to your script to verify that the installerURLs you are providing are what you expect. Hope that helps!

@gnpaone
Copy link
Author

gnpaone commented Mar 11, 2022

So looking at your script, there are a couple things I am noticing:

  1. You have a typo on line 3 where you wrote $filenam64 and it should be $filename64
  2. On line 4 and 5, I don't think you need the extra $ inside the curly braces, I believe it should be just:
$url="https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/${filename}"
$url64="https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/${filename64}"
  1. I would double check to make sure that your usage of string interpolation for your --u $url and $url64 are correct. I believe you need an enclosing "${url}|x64" around each url if you include them within quotations. Not 100% sure though so you'll need to check that.

Regarding the error message, the reason why Updating a manifest is only supported with the same number of installer URLs is showing up is because we don't allow duplicate installerUrls and only accept unique installerURLs. Since there is an issue with the urls you provided and both of them are shown as https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/, only one installerURL is showing up in the tool. We don't modify or change any of the installerURLs provided to the tool (except trimming), so I would add print statements to your script to verify that the installerURLs you are providing are what you expect. Hope that helps!

Hey, thanks for the help, it worked (my bad that I didn't notice the typo 😅), https://github.com/gnpaone/MSEdgeRedirect/actions/runs/1966585425 😊
One more thing, if at all I have to use/change settings in settings.json file of wingetcreate.exe instead of wingetcreate-self-contained.exe where does that settings.json of wingetcreate.exe file located? I'm asking this because this is where I got stuck at the very beginning of tests.

@gnpaone
Copy link
Author

gnpaone commented Mar 11, 2022

Yeah, without double quotes for url it fails (https://github.com/gnpaone/MSEdgeRedirect/runs/5507275073?check_suite_focus=true). One more small doubt, does GitHub CI method create new package too instead of just updating manifests?

@ryfu-msft
Copy link
Contributor

So looking at your script, there are a couple things I am noticing:

  1. You have a typo on line 3 where you wrote $filenam64 and it should be $filename64
  2. On line 4 and 5, I don't think you need the extra $ inside the curly braces, I believe it should be just:
$url="https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/${filename}"
$url64="https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/${filename64}"
  1. I would double check to make sure that your usage of string interpolation for your --u $url and $url64 are correct. I believe you need an enclosing "${url}|x64" around each url if you include them within quotations. Not 100% sure though so you'll need to check that.

Regarding the error message, the reason why Updating a manifest is only supported with the same number of installer URLs is showing up is because we don't allow duplicate installerUrls and only accept unique installerURLs. Since there is an issue with the urls you provided and both of them are shown as https://github.com/gnpaone/MSEdgeRedirect/releases/download/0.6.3.0/, only one installerURL is showing up in the tool. We don't modify or change any of the installerURLs provided to the tool (except trimming), so I would add print statements to your script to verify that the installerURLs you are providing are what you expect. Hope that helps!

Hey, thanks for the help, it worked (my bad that I didn't notice the typo 😅), https://github.com/gnpaone/MSEdgeRedirect/actions/runs/1966585425 😊 One more thing, if at all I have to use/change settings in settings.json file of wingetcreate.exe instead of wingetcreate-self-contained.exe where does that settings.json of wingetcreate.exe file located? I'm asking this because this is where I got stuck at the very beginning of tests.

Both wingetcreate.exe and wingetcreate-self-contained.exe target the same settings.json file which is located in the following path: %LOCALAPPDATA%\Microsoft.WindowsPackageManagerManifestCreator_8wekyb3d8bbwe\LocalState\settings.json

@ryfu-msft
Copy link
Contributor

Yeah, without double quotes for url it fails (https://github.com/gnpaone/MSEdgeRedirect/runs/5507275073?check_suite_focus=true). One more small doubt, does GitHub CI method create new package too instead of just updating manifests?

I'm not sure what you mean by "does GitHubCI method create new package". WingetCreate can create a new manifest, but that is interactive and can't be used in a CI/CD scenario.

@gnpaone
Copy link
Author

gnpaone commented Mar 11, 2022

Both wingetcreate.exe and wingetcreate-self-contained.exe target the same settings.json file which is located in the following path: %LOCALAPPDATA%\Microsoft.WindowsPackageManagerManifestCreator_8wekyb3d8bbwe\LocalState\settings.json

Actually no, wingetcreate-self-contained.exe creates settings.json file in %LOCALAPPDATA%\Microsoft\WindowsPackageManagerManifestCreator\settings.json so that is why I could edit that for custom repo settings in GitHub CI, for confirmation purpose I also added code to download artifacts containing the settings.json file. Similarly, wingetcreate.exe creates settings.json somewhere else.

@ryfu-msft
Copy link
Contributor

Both wingetcreate.exe and wingetcreate-self-contained.exe target the same settings.json file which is located in the following path: %LOCALAPPDATA%\Microsoft.WindowsPackageManagerManifestCreator_8wekyb3d8bbwe\LocalState\settings.json

Actually no, wingetcreate-self-contained.exe creates settings.json file in %LOCALAPPDATA%\Microsoft\WindowsPackageManagerManifestCreator\settings.json so that is why I could edit that for custom repo settings in GitHub CI, for confirmation purpose I also added code to download artifacts containing the settings.json file. Similarly, wingetcreate.exe creates settings.json somewhere else.

Ah my apologies, you are correct. That settings.json path is if you installed the tool using the MSIX bundle.

Closing this issue as I believe everything has been addressed.

@gnpaone
Copy link
Author

gnpaone commented Mar 15, 2022

Both wingetcreate.exe and wingetcreate-self-contained.exe target the same settings.json file which is located in the following path: %LOCALAPPDATA%\Microsoft.WindowsPackageManagerManifestCreator_8wekyb3d8bbwe\LocalState\settings.json

Actually no, wingetcreate-self-contained.exe creates settings.json file in %LOCALAPPDATA%\Microsoft\WindowsPackageManagerManifestCreator\settings.json so that is why I could edit that for custom repo settings in GitHub CI, for confirmation purpose I also added code to download artifacts containing the settings.json file. Similarly, wingetcreate.exe creates settings.json somewhere else.

Ah my apologies, you are correct. That settings.json path is if you installed the tool using the MSIX bundle.

Closing this issue as I believe everything has been addressed.

Thanks for the help 😊

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

2 participants