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

Fix #153: Prevent stdout cutoff in Azure CLI versions #154

Merged
merged 4 commits into from
Jul 18, 2024
Merged

Conversation

MoChilia
Copy link
Member

Fix the issue #153, replace curl with a GET request to prevent stdout cutoff in Azure CLI versions, avoiding warnings in workflows.

Close #153

src/main.ts Outdated
await exec.exec("curl", ["--location", "-s", "https://mcr.microsoft.com/v2/azure-cli/tags/list"], execOptions)
if (outStream && JSON.parse(outStream).tags) {
return JSON.parse(outStream).tags;
const response = await axios.get('https://mcr.microsoft.com/v2/azure-cli/tags/list');
Copy link

Choose a reason for hiding this comment

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

Since this action runs on Node 20, native fetch is available and wouldn't require an additional dependency.

Copy link

@MeikeMertschFortum MeikeMertschFortum Jul 15, 2024

Choose a reason for hiding this comment

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

I am happy to try it out again from a branch on my workflow if that helps and you want to test the change.

EDIT: Running...
Sorry, our run will be delayed, because we just managed to deploy a bug and the workflow will run a lot longer than normal

Copy link

@MeikeMertschFortum MeikeMertschFortum left a comment

Choose a reason for hiding this comment

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

I ran against this branch once use fetch instead was merged and tests were green:
I don't see the warning anymore and the action appears to be working as expected on our self-hosted runners ✅

Copy link

@MeikeMertschFortum MeikeMertschFortum left a comment

Choose a reason for hiding this comment

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

I don't know if I am allowed to approve, but here I am... :)

@jakub7722
Copy link

I'm not sure what happened here, but this fix does not work for me. It almost looks as if something got cached? I have no clue how the same python error can appear here if curl was eliminated? Is there any other instance of curl somewhere?
Screenshot 2024-07-17 at 11 37 10

@MoChilia
Copy link
Member Author

Hi @jakub-lesniak-ikea, does it work for you with v2 tag?

@jakub7722
Copy link

Hi @jakub-lesniak-ikea, does it work for you with v2 tag?

No it does not, that was the reason I started testing the fix-153. It somehow looks like the error that I am getting might not be related to the action at all. I just tested with simple bash action that utilises the CLI installed on the agent and got the same error - which suggests that it might be coming from the CLI itself.

Copy link

@jakub7722 jakub7722 left a comment

Choose a reason for hiding this comment

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

Tested & it solves the original issue. I just had a very similar one related to my code which confused me cause I saw the same error messages before & after.

@MeikeMertschFortum
Copy link

MeikeMertschFortum commented Jul 18, 2024

@MoChilia can you tell me/us what the process and requirements are for approval to merge this? Do we still have to do something?

@MoChilia MoChilia requested a review from YanaXu July 18, 2024 06:37
@MoChilia MoChilia merged commit 19a34e5 into master Jul 18, 2024
8 checks passed
@MoChilia MoChilia deleted the fix-153 branch July 18, 2024 09:33
@MoChilia
Copy link
Member Author

@luc122c, @MeikeMertschFortum, @jakub-lesniak-ikea, it has now been merged into master. You can point to master as a temporary workaround. I will inform you once the new version is released.

@MeikeMertschFortum
Copy link

Thank you for your help

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 this pull request may close these issues.

Unable to fetch all az cli versions (azure/CLI@v2)
5 participants