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

GitHub Comments for Merge Queue #4663

Open
MaximilianoAdaro opened this issue Sep 9, 2024 · 8 comments
Open

GitHub Comments for Merge Queue #4663

MaximilianoAdaro opened this issue Sep 9, 2024 · 8 comments

Comments

@MaximilianoAdaro
Copy link

Hi Team,

I'm currently using dd-trace-js in my GitHub Actions workflows and have successfully integrated Datadog GitHub comments for pull requests. However, I am facing challenges when trying to enable GitHub comments for the Merge Queue (MQ) level.

The goal is to have Datadog post comments on GitHub pull requests that are part of the Merge Queue, similar to how it works for individual pull requests. This would greatly enhance our visibility and traceability during the merge process.

Could you please provide guidance or best practices on how to achieve this? Are there specific configurations or environment variables that need to be set to enable GitHub comments for the Merge Queue?

An example here, the branches starting with gh-readonly-queue/master/... are the one from the MQ
image

Any help or pointers would be greatly appreciated! cc @juan-fernandez

Thank you!

@juan-fernandez
Copy link
Collaborator

hey @MaximilianoAdaro , thanks for bringing up the topic. I'll talk with the team internally and get back to you as soon as possible 😄

@juan-fernandez
Copy link
Collaborator

@MaximilianoAdaro to make sure we understand:

The goal is to have Datadog post comments on GitHub pull requests that are part of the Merge Queue, similar to how it works for individual pull requests. This would greatly enhance our visibility and traceability during the merge process.

you'd like the results from gh-readonly-queue/master/... branches to show up in its original PR, right?

Something like

  1. You open a PR.
  2. Datadog posts a PR comment with test results.
  3. You add the PR to the merge queue.
  4. Tests are run and reported to datadog.
  5. (New!) Datadog posts an additional PR comment with results from the merge queue. Or maybe updates the existing PR comment?

@MaximilianoAdaro
Copy link
Author

That's right @juan-fernandez
I can get the PR number parsing the gh-readonly-queue/master/pr-***... branches. That's why I asked if setting an env variable would solve this.
And yes, updating the existing PR comment works!!

@juan-fernandez
Copy link
Collaborator

I understand. This would be a feature request. Let me get back to you once we have prioritized it.

That's why I asked if setting an env variable would solve this.

If you "trick" the datadog library into thinking it runs in the source branch (the one about to be merged) instead of gh-readonly-queue/master/pr-***..., the PR comment will be updated, but I don't think github allows you to define env vars on merge queue job executions, or does it? (I'm not very familiar with GH merge queues)

@MaximilianoAdaro
Copy link
Author

If you "trick" the datadog library into thinking it runs in the source branch (the one about to be merged) instead of gh-readonly-queue/master/pr-***..., the PR comment will be updated, but I don't think github allows you to define env vars on merge queue job executions, or does it? (I'm not very familiar with GH merge queues)

I was wondering if it's possible to send a DD_BRANCH or DD_PULL_REQUEST number to DD to change the source branch in DDog CI Visibility. However, I'm not sure if it's possible to receive these env variables from the Datadog side.

@juan-fernandez
Copy link
Collaborator

that's not currently possible.

The way we'll proceed here is by attempting to detect gh-readonly-queue/ branches automatically and looking for an associated PR. The feature implementation might take a bit but I'll keep you updated 😄

@MaximilianoAdaro
Copy link
Author

Hello @juan-fernandez!
Do you have any updates on this?? I'd be extremely useful 🙏

@juan-fernandez
Copy link
Collaborator

hey @MaximilianoAdaro, sorry, no updates yet

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

No branches or pull requests

2 participants