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

Handle missing example files gracefully #1950

Merged
merged 5 commits into from
Feb 1, 2023

Conversation

chadwhitacre
Copy link
Member

@chadwhitacre chadwhitacre commented Feb 1, 2023

We're seeing a bit of noise in our dogfooding instance from cases where it seems folks have mucked with the example files we expect to exist. Let's give a more specific error message in this case and avoid reporting to dogfooding.

@chadwhitacre
Copy link
Member Author

Expecting e186a79 to fail with a generic error.

@chadwhitacre
Copy link
Member Author

https://github.com/getsentry/self-hosted/actions/runs/4067040190/jobs/7003897054#step:5:173

Ensuring Relay credentials ...
  Creating ../relay/config.yml...
  cp: cannot stat '../relay/config.example.yml': No such file or directory
  Error in ./install/_lib.sh:48.
  'cp -n $(echo "$1" | sed 's/\.[^.]*$/.example&/') "$1"' exited with status 1
  yes: standard output: Broken pipe
  yes: standard output: Broken pipe
  yes: standard output: Broken pipe
  -> ./install.sh:main:26
  --> ensure-relay-credentials.sh:source:6
  ---> ./install/_lib.sh:ensure_file_from_example:48

@chadwhitacre
Copy link
Member Author

I confirmed that an exit in a function exits the whole script, with default 0 ofc.

@chadwhitacre
Copy link
Member Author

Getting the "Oops!" but the test is still red. 🤔

https://github.com/getsentry/self-hosted/actions/runs/4067238068/jobs/7004344020#step:5:174

@chadwhitacre
Copy link
Member Author

Yeah okay so install.sh is exiting cleanly and proceeding to run.sh.

- name: Integration Test
run: ./integration-test.sh

echo "Testing initial install"
./install.sh
./_integration-test/run.sh

  Oops! Where did ../relay/config.example.yml go? 🤨 We need it in order to create ../relay/config.yml.
  + ./_integration-test/run.sh

https://github.com/getsentry/self-hosted/actions/runs/4067238068/jobs/7004344020#step:5:175

If install.sh exits with > 0 I bet run.sh won't be called due to ...

@chadwhitacre
Copy link
Member Author

Testing in e977937 ...

@chadwhitacre
Copy link
Member Author

I'm expecting to see the "Oops!" and then the integration-test.sh terminates.

@chadwhitacre
Copy link
Member Author

Boom!

  Oops! Where did ../relay/config.example.yml go? 🤨 We need it in order to create ../relay/config.yml.
  Error: Process completed with exit code 42.
  ##[debug]Finishing: Integration Test

Okay, ready for review.

@chadwhitacre chadwhitacre merged commit 0890133 into master Feb 1, 2023
@chadwhitacre chadwhitacre deleted the cwlw/handle-missing-example-gracefully branch February 1, 2023 19:12
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants