Skip to content

Conversation

@cormacpayne
Copy link
Member

Recently, the workflowName property was removed from the /subscriptions/resourceGroups/providers/Microsoft.App/containerApps/sourcecontrols/current API, which represented the name of the YAML workflow file created for the user via containerapp up --source (or through the Continuous Deployment blade in the Azure Portal), which allowed users to build and deploy their application using GitHub Actions.

As a result of this property being removed, certain calls in the up flow when --source was provided (such as here and here) are throwing exceptions when attempting to access the property in the API response.

With this PR, a new function is introduced, get_workflow_name, that will user the GitHub API (specifically, this call) to fetch the files in given repository's branch, and see if any within the .github/workflows folder match the expected YAML file name ({containerAppName}-AutoDeployTrigger-{guid}.yml).


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az containerapp up

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

- [ ] My extension description/summary conforms to the Extension Summary Guidelines.

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd
Copy link

Hi @cormacpayne,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@ghost ghost requested a review from yonzhan June 20, 2023 20:06
@ghost ghost added the Auto-Assign Auto assign by bot label Jun 20, 2023
@ghost ghost requested a review from wangzelin007 June 20, 2023 20:06
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 20, 2023

Thank you for your contribution! We will review the pull request and get back to you soon.

@ghost ghost requested a review from yanzhudd June 20, 2023 20:06
@ghost ghost assigned zhoxing-ms Jun 20, 2023
@ghost ghost added the ContainerApp label Jun 20, 2023
@ghost ghost requested review from jsntcy and zhoxing-ms June 20, 2023 20:06
@zhoxing-ms
Copy link
Contributor

Could you please add test case for this PR change

…into corm/capps-fix-workflow-poll

# Conflicts:
#	src/containerapp/HISTORY.rst
@cormacpayne
Copy link
Member Author

@zhoxing-ms -- Hey Xing, for this specific flow that we're fixing, it relies on creating a workflow YAML file in a user's GitHub repository that then triggers a GitHub Action run. Creating a test for this would be tricky when it comes to maintaining the repository that the workflow is created in, managing the secrets to push to this repository, etc. Is there another route we can take for testing this flow that you have any guidance on? Thanks in advance.

@zhoxing-ms
Copy link
Contributor

@cormacpayne I see, this is indeed difficult to create scenario tests, so manual testing can ensure that the process meets expectations. So I'll merge this PR first

@zhoxing-ms zhoxing-ms merged commit c75a906 into Azure:main Jun 27, 2023
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ containerapp ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=67193&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot ContainerApp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants