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

Version 1.2 throws with "could not find 'app.yml' file" #303

Closed
nwaughachukwuma opened this issue Mar 9, 2023 · 10 comments · Fixed by #308
Closed

Version 1.2 throws with "could not find 'app.yml' file" #303

nwaughachukwuma opened this issue Mar 9, 2023 · 10 comments · Fixed by #308
Labels
bug Something isn't working

Comments

@nwaughachukwuma
Copy link

nwaughachukwuma commented Mar 9, 2023

TL;DR

The new version 1.2 fails with the following error.

Error: google-github-actions/deploy-appengine failed with: could not find "app.yml" file

Expected behavior

Deployment should succeed without error with other things remaining the same.

Observed behavior

Deployment fails with the following error.

Error: google-github-actions/deploy-appengine failed with: could not find "app.yml" file

Action YAML

on:
  workflow_call:
    inputs:
      PROJECT:
        required: true
        type: string
      VERSION:
        required: true
        type: string
      PROMOTE:
        required: false
        type: string
        default: 'false'
      CONFIG_FILE:
        required: true
        type: string
      PROJECT_ID:
        required: true
        type: string
      NOT_RENOVATE:
        required: true
        type: string
      HEALTH_CHECK_PATH:
        required: false
        default: ''
        type: string
      BASE_PATH:
        required: false
        default: ''
        type: string
      SERVICE:
        required: true
        type: string
      PING_WARMUP:
        required: false
        default: false
        type: boolean
      WORKING_DIRECTORY:
        required: true
        type: string
    secrets:
      SERVICE_ACCOUNT_KEY:
        required: true

jobs:
  deploy:
    timeout-minutes: 10
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - uses: actions/download-artifact@v3
        with:
          name: ${{ inputs.PROJECT }}
          path: ${{ inputs.WORKING_DIRECTORY }}
      - uses: google-github-actions/auth@v1
        with:
          credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
      - uses: google-github-actions/setup-gcloud@v1
      - id: deploy
        uses: google-github-actions/deploy-appengine@v1
        with:
          project_id: ${{ inputs.PROJECT_ID }}
          deliverables: ${{ inputs.CONFIG_FILE }}
          promote: ${{ inputs.PROMOTE }}
          version: ${{ inputs.VERSION }}
          working_directory: ${{ inputs.WORKING_DIRECTORY }}
      - name: health check
        run: curl -f "${{ steps.deploy.outputs.version_url }}${{ inputs.BASE_PATH }}${{ inputs.HEALTH_CHECK_PATH }}"
      - name: warmup
        if: ${{ inputs.PING_WARMUP }}
        run: curl -f "${{ steps.deploy.outputs.version_url }}/_ah/warmup"
      - uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: ${{ inputs.PROJECT }}
          message: |
            ${{ inputs.PROJECT }}: ${{ steps.deploy.outputs.version_url }}${{ inputs.BASE_PATH }} (${{ github.event.pull_request.head.sha }})

Log output

Changing into working directory: src/apps/admin-app
Error: google-github-actions/deploy-appengine failed with: could not find "app.yml" file

Additional information

Reverting to v1.1.0 fixed the issue.

@nwaughachukwuma nwaughachukwuma added the bug Something isn't working label Mar 9, 2023
@clintonb
Copy link

clintonb commented Mar 9, 2023

@sethvargo
Copy link
Member

Duplicate of #302, fix is in #305.

@sethvargo
Copy link
Member

Actually wait - this is a slightly different error.

@sethvargo sethvargo reopened this Mar 9, 2023
@sethvargo
Copy link
Member

How are you deploying without an app.yaml deliverable?

@clintonb
Copy link

clintonb commented Mar 9, 2023

Our files are named app-dev.yaml and app-prod.yaml.

- id: deploy-dev
  name: 'Deploy dev services'
  uses: google-github-actions/deploy-appengine@v1
  with:
    promote: true
    deliverables: services/flex-worker/app-dev.yaml
    flags: '--stop-previous-version'
  env: 
    CLOUDSDK_APP_CLOUD_BUILD_TIMEOUT: 1200

@clintonb
Copy link

clintonb commented Mar 9, 2023

The new version is a bit too "smart".

@sethvargo
Copy link
Member

I see. In order to update environment variables, we need to know the app.yaml. I've updated the logic in #305 to only try and parse the app.yaml if env/build_env is given. But short of reading the entire list of deliverables, I don't think we have a good way to determine which one is the "appyaml".

@sethvargo
Copy link
Member

v1.2.1 was just released. If you do not set env_variables or build_env_variables, everything should work correctly. However, specifying those fields (which are new in 1.2) require the file to be named app.yaml.

If v1.2.1 fixes the issue, we can consider this enhancement to accept other appyaml file names, but it will be a slightly larger refactor and my primary goal is restoring the old behavior.

@clintonb
Copy link

Confirmed that our deploys are working once more after renaming to (dev|prod)-app.yaml.

@sethvargo
Copy link
Member

Hi @clintonb - with 1.2.1, you should be able to use dev-app.yaml and prod-app.yaml. You just cannot do that and set envvars or build envvars. Can you confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants