Skip to content

Stuck failed check if a non-existent directory or project is given #2557

Open
@nitrocode

Description

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

A permanent failed check is shown if a non-existent directory or project is given to atlantis plan.

atlantis plan -d global/testing123
atlantis plan -p testing123

Even though seeing the red check marks is annoying, since only the atlantis/plan is required, the new failed status checks do not prevent merging of the PR.

Instead, it would be nice to do one of the following

  1. Allow clearing all status checks when either running atlantis unlock OR closing the PR and reopening the PR. I tried this and it did not work.
  2. When a non-existent dir/project is given, update only the atlantis/plan context status (instead of atlantis/plan: <dir/project given> so it can be easily updated by running atlantis plan without -d or -p
  3. Allow subsequent atlantis plans (without -d or -p) to set the status for any pr checks that failed to be planned due to a missing dir/project
  4. Better option ? A mixture of the above ?

Status

✗ gh api \
  -H "Accept: application/vnd.github+json" \
  /repos/{owner}/{repo}/commits/{ref}/statuses | \
  jq '.[] | select(.state=="failure")'
{
  "url": "https://api.github.com/repos/{owner}/{repo}/statuses/{ref}",
  "avatar_url": "https://avatars.githubusercontent.com/u/<redacted>?v=4",
  "id": "<redacted>",
  "node_id": "<redacted>",
  "state": "failure",
  "description": "Plan failed.",
  "target_url": "http://<redacted>.com/jobs/<redacted>",
  "context": "atlantis/plan: <redacted>",
  "created_at": "2022-10-05T23:58:50Z",
  "updated_at": "2022-10-05T23:58:50Z",
}

Workaround is to update the status for now

gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  /repos/{owner}/{repo}/commits/{ref}/statuses \
  -f state='success' \
  -f target_url="http://<redacted>.com/jobs/<redacted>" \
  -f description="skipped" \
  -f context="atlantis/plan: <redacted>"

Reproduction Steps

  1. Do not create a directory called global/testing123
  2. Do not create a project called testing123
  3. Run the commands above to show a failed check

Logs

N/A

Environment details

  • Atlantis version: 0.19.9

N/A

Additional Context

N/A

Activity

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedGood feature for contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions