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

RSDK-7885: Send Event to Run Networking Tests on Release Candidate #4083

Conversation

danielbotros
Copy link
Contributor

@danielbotros danielbotros commented Jun 14, 2024

Description

  • RSDK-7885: Run Networking Tests on release Candidate
  • See this pr
    • On RC build and upload success, sends an event to sdk-integration-test repo which triggers Networking Tests workflow for rc builds

Testing

  • Running this command will trigger Networking Tests in the sdk-integration-tests repo:
gh api \       
  -X POST \
  -H "Accept: application/vnd.github+json" \
  /repos/viamrobotics/sdk-integration-tests/dispatches \
  -f event_type=new_rc_branch

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Jun 14, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jun 14, 2024
- name: Trigger Workflow
run: |
curl -X POST \
-H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
Copy link
Contributor Author

@danielbotros danielbotros Jun 14, 2024

Choose a reason for hiding this comment

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

I'm not sure if this is the right token needed to be able to run this curl, but it does need to have multiple repo write access to work. Theoretically with the token I could run this command to see if it triggers the workflow as well

Copy link
Member

Choose a reason for hiding this comment

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

We're gonna have to test this offline; let's check in with some combination of @abe-winter + @maximpertsov.

Copy link
Member

Choose a reason for hiding this comment

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

another testing option -- make this its own file, give it a workflow_dispatch event, and run manually

(no harm in running extra sdk tests)

I have no preference though, do whatever works best for sdk team.

Copy link
Member

@benjirewis benjirewis left a comment

Choose a reason for hiding this comment

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

Nice!

- name: Trigger Workflow
run: |
curl -X POST \
-H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
Copy link
Member

Choose a reason for hiding this comment

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

We're gonna have to test this offline; let's check in with some combination of @abe-winter + @maximpertsov.

-H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/viamrobotics/sdk-integration-tests/dispatches \
-d '{"event_type":"new_rc_branch"}'
Copy link
Member

Choose a reason for hiding this comment

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

[nit] Missing newline at EOF here?

@@ -67,3 +67,17 @@ jobs:
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
channel: '#team-devops'
name: 'Workflow Status'

run-sdk-networking-tests:
needs: [test, staticbuild, appimage]
Copy link
Member

Choose a reason for hiding this comment

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

[nit + q] I don't think this "needs" test, as both of staticbuild and appimage "need" it already (i.e. it's transitively "needed"). Also, does appimage finishing ensure that the new RC builds will be available to test against from the SDK integration tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe so as the last step of the appimage workflow is to output links to the newly uploaded RC builds, and this job won't run until appimage is successful

run: |
curl -X POST \
-H "Authorization: token ${{secrets.GITHUB_TOKEN}}" \
-H "Accept: application/vnd.github.everest-preview+json" \
Copy link
Member

Choose a reason for hiding this comment

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

per this I think everest-preview is no longer current

from here I think it's okay to use vnd.github+json now

Copy link
Member

Choose a reason for hiding this comment

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

Spoke offline with @abe-winter, but I re-iterate that it's a little crazy that GHCI has no "builtin" way of doing this...

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jun 17, 2024
@cheukt cheukt removed their request for review June 17, 2024 20:14
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/viamrobotics/sdk-integration-tests/dispatches \
-d '{"event_type":"new_rc_branch"}'

Copy link
Member

Choose a reason for hiding this comment

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

Something's up with your editor here, as there's still no terminating newline. Maybe try https://stackoverflow.com/questions/44704968/visual-studio-code-insert-newline-at-the-end-of-files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the tip! will never have this issue again 😼

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jun 18, 2024
Copy link
Member

@benjirewis benjirewis left a comment

Choose a reason for hiding this comment

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

LGTM as long as we're confident the secrets.REPO_READ_TOKEN will correctly authorize the curl 🧑‍🔧 .

@maximpertsov
Copy link
Contributor

LGTM as long as we're confident the secrets.REPO_READ_TOKEN will correctly authorize the curl 🧑‍🔧 .

If it doesn't, will this workflow be marked as a failure? And if so, does that mess up any release workflows downstream? @abe-winter

Copy link
Member

@abe-winter abe-winter left a comment

Choose a reason for hiding this comment

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

would normally say 'merge + test in prod' but it would be bad to break the RC workflow

imo it's worth finding a way to test this that isn't 'run an RC' (RCs are kind of stateful because of the go sumdb)

recommendation: make this its own yaml file with on: workflow_call and workflow_dispatch, merge to main, run manually + see what happens; then invoke via workflow call from releasecandidate.yml file

(can talk through live if helpful)

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jun 20, 2024
@danielbotros danielbotros force-pushed the RSDK-7885-send-event-to-trigger-networking-tests-on-rc branch from 7022470 to 578ae66 Compare June 20, 2024 19:33
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jun 20, 2024
Copy link
Contributor

@maximpertsov maximpertsov left a comment

Choose a reason for hiding this comment

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

The PR looks good pending testing suggested here #4083 (review)

@danielbotros danielbotros merged commit 9321c4f into viamrobotics:main Jun 20, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants