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

Debug CI #1273

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
bc03d78
Constrain tests to failing
chadwhitacre Jan 24, 2022
351dfd9
Log output of failing command
chadwhitacre Feb 1, 2022
42d436f
Blerp, cat here?
chadwhitacre Feb 1, 2022
8617354
What does credentials.json contain?
chadwhitacre Feb 1, 2022
b290637
ls too
chadwhitacre Feb 1, 2022
07c025c
Why can't we do this? 🤔
chadwhitacre Feb 1, 2022
59fc64c
Blah
chadwhitacre Feb 1, 2022
2ead232
Wrong path
chadwhitacre Feb 1, 2022
0221e3e
Whittle down test case
chadwhitacre Feb 1, 2022
dcd1e25
More parity with local
chadwhitacre Feb 1, 2022
f5530e6
Oops, bash
chadwhitacre Feb 1, 2022
32b4119
Moar compat
chadwhitacre Feb 1, 2022
c2db537
This should result in ro volume
chadwhitacre Feb 1, 2022
9c3da83
Bring this back
chadwhitacre Feb 1, 2022
5ba5b5b
Blerp
chadwhitacre Feb 1, 2022
ca64965
Back to hack test file
chadwhitacre Feb 1, 2022
167082f
Where am I?
chadwhitacre Feb 1, 2022
d14d00e
Make reset more useful
chadwhitacre Feb 1, 2022
efcbdf3
Mock ensure file config yml
chadwhitacre Feb 1, 2022
cf08799
Can we use a tmp file?
chadwhitacre Feb 1, 2022
6c2c1a9
Log helper
chadwhitacre Feb 1, 2022
9ff6efb
More logging inside container
chadwhitacre Feb 1, 2022
a65fdb4
moar info in the container
chadwhitacre Feb 1, 2022
fc05c29
more info
chadwhitacre Feb 1, 2022
87f9c6c
no ps i guess
chadwhitacre Feb 1, 2022
4f9c86d
Update test-relay
chadwhitacre Feb 1, 2022
33ce378
Update test-relay
chadwhitacre Feb 1, 2022
1ab391b
newline?
chadwhitacre Feb 1, 2022
5f67f7b
too much stdout?
chadwhitacre Feb 1, 2022
e8283d2
More cleanup
chadwhitacre Feb 1, 2022
dac40f5
Alt fix
chadwhitacre Feb 1, 2022
9adc223
Messed something up?
chadwhitacre Feb 1, 2022
b78d45a
Test a stderr hypothesis
chadwhitacre Feb 1, 2022
d50ba99
Test a couple other versions
chadwhitacre Feb 1, 2022
f6235fc
Hack this tho
chadwhitacre Feb 1, 2022
75a6475
Smash, bash
chadwhitacre Feb 1, 2022
3c1e3f3
Whaaa
chadwhitacre Feb 1, 2022
da25f15
explicit stderr
chadwhitacre Feb 1, 2022
0c6c396
Test image cache across matrix
chadwhitacre Feb 1, 2022
6e8d37d
What was I seeing?
chadwhitacre Feb 1, 2022
24b81bd
Experiment with -T
chadwhitacre Feb 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ defaults:
run:
shell: bash
jobs:
unit-test:
runs-on: ubuntu-20.04
name: "unit tests"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Unit Tests
working-directory: install
run: find ./ -type f -name "*-test.sh" -exec "./{}" \;

integration-test:
runs-on: ubuntu-20.04
name: "integration test"
Expand All @@ -32,8 +21,6 @@ jobs:
include:
- compose_version: '1.28.0'
compose_path: '/usr/local/bin'
- compose_version: 'v2.0.1'
compose_path: '/usr/local/lib/docker/cli-plugins'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion _integration-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ PROJECT_ID=${DSN_PIECES[1]}
TEST_EVENT_ID=$(export LC_ALL=C; head /dev/urandom | tr -dc "a-f0-9" | head -c 32)
# Thanks @untitaker - https://forum.sentry.io/t/how-can-i-post-with-curl-a-sentry-event-which-authentication-credentials/4759/2?u=byk
echo "Creating test event..."
curl -sf --data '{"event_id": "'"$TEST_EVENT_ID"'","level":"error","message":"a failure","extra":{"object":"42"}}' -H 'Content-Type: application/json' -H "X-Sentry-Auth: Sentry sentry_version=7, sentry_key=$SENTRY_KEY, sentry_client=test-bash/0.1" "$SENTRY_TEST_HOST/api/$PROJECT_ID/store/" -o /dev/null
curl -f --data '{"event_id": "'"$TEST_EVENT_ID"'","level":"error","message":"a failure","extra":{"object":"42"}}' -H 'Content-Type: application/json' -H "X-Sentry-Auth: Sentry sentry_version=7, sentry_key=$SENTRY_KEY, sentry_client=test-bash/0.1" "$SENTRY_TEST_HOST/api/$PROJECT_ID/store/" -o out && cat out || cat out

EVENT_PATH="projects/sentry/internal/events/$TEST_EVENT_ID/"
export -f sentry_api_request get_csrf_token
Expand Down
5 changes: 5 additions & 0 deletions install/relay-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RELAY_CREDENTIALS_JSON="../relay/credentials.json"

ensure_file_from_example $RELAY_CONFIG_YML

$dc version
if [[ ! -f "$RELAY_CREDENTIALS_JSON" ]]; then

# We need the ugly hack below as `relay generate credentials` tries to read
Expand All @@ -20,6 +21,10 @@ if [[ ! -f "$RELAY_CREDENTIALS_JSON" ]]; then
> "$RELAY_CREDENTIALS_JSON"
Copy link
Member

@BYK BYK Feb 1, 2022

Choose a reason for hiding this comment

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

Maybe we should add that -T here right after $dcr? Since the file is there but it is empty, makes me think this is a stdout redirection related issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a reason 07c025c won't work?

Copy link
Member

Choose a reason for hiding this comment

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

Because, read the giant comment I left there? 😁

Copy link
Member Author

Choose a reason for hiding this comment

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

I read it but I couldn't make sense of it.

relay generate credentials tries to read the config and the credentials even with the --stdout and --overwrite flags and then errors out when the credentials file exists but not valid JSON. We hit this case as we redirect output to the same config folder, creating an empty credentials file before relay runs.

So no shell redirect means no credentials file created before relay runs means no error parsing JSON?

Copy link
Member

Choose a reason for hiding this comment

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

Hard for me to recollect the whole memory but let me try:

  1. We do have a config for Relay in place, either one the end-user created or the one we copied from the example file
  2. When you run relay generate credentials even with --overwrite it tries to read both the config and the credentials (this happens only when you have the config in place)
  3. Relay yells at us if it cannot read/parse credentials file and stops
  4. Even when we say "ignore that, overwrite or write the output to stdout" Relay still acts like a fussy toddler


echo "Relay credentials written to $RELAY_CREDENTIALS_JSON"
ls ../relay
cat "$RELAY_CREDENTIALS_JSON"
else
echo "$RELAY_CREDENTIALS_JSON already exists, skipped creation."
fi

echo "${_endgroup}"