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

Parse logs for FOSSA action to determine actual license scan failures #16

Merged
merged 10 commits into from
Apr 19, 2023

Conversation

hubertdeng123
Copy link
Member

@hubertdeng123 hubertdeng123 commented Apr 10, 2023

This parses FOSSA scan logs to check for error or specific license scanning failure. closes getsentry/team-ospo#124

FOSSA connection failure still passing CI: https://github.com/getsentry/sentry/actions/runs/4682991144/attempts/1
FOSSA connection license scan failure failing CI: https://github.com/getsentry/sentry/actions/runs/4692294461/attempts/1
FOSSA license scan success passing CI: https://github.com/getsentry/sentry/actions/runs/4702538858/jobs/8342542104?pr=47273
FOSSA timeout but still passing CI: https://github.com/getsentry/sentry/actions/runs/4702538858/jobs/8339925767?pr=47273

@hubertdeng123 hubertdeng123 changed the title Test: Parse logs for FOSSA action Parse logs for FOSSA action to determine actual license scan failures Apr 13, 2023
@hubertdeng123 hubertdeng123 marked this pull request as ready for review April 14, 2023 23:15
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated
fi
curl -sL https://sentry.io/get-cli/ | sh
error_msg=$(cat test_logs.txt | grep -zoP '(?<=>>> Relevant errors\n\n Error\n\n ).*?(?=\n)' || echo 'unknown error message')
sentry-cli send-event -m "FOSSA test error: $error_msg" -t repo:$GITHUB_REPOSITORY -e url:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID --logfile test_logs.txt
Copy link
Member

Choose a reason for hiding this comment

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

Let's trim this up here and in the analyze case so we get more of the useful error message in the UI.

Suggested change
sentry-cli send-event -m "FOSSA test error: $error_msg" -t repo:$GITHUB_REPOSITORY -e url:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID --logfile test_logs.txt
sentry-cli send-event -m "test: $error_msg" -t repo:$GITHUB_REPOSITORY -e url:$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID --logfile test_logs.txt

@hubertdeng123 hubertdeng123 merged commit 26a9658 into main Apr 19, 2023
@hubertdeng123 hubertdeng123 deleted the hubertdeng123/parse-logs-fossa branch April 19, 2023 19:32
@chadwhitacre chadwhitacre mentioned this pull request Apr 24, 2023
36 tasks
hubertdeng123 added a commit to getsentry/sentry that referenced this pull request Apr 25, 2023
This PR re-enables FOSSA license compliance scans. The action has been
running for a few days now in all repos except `getsentry`, `snuba`, and
`sentry` without issues. Changes have been made to the action to make
sure it is more resilient to FOSSA errors (outages, network issues)

Here's the relevant PR in the license scan action:
getsentry/action-enforce-license-compliance#16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FOSSA Scan Punchlist Items
2 participants