-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(CI): Add a new task to automatically assign a team label on a dependabot PR #21952
base: main
Are you sure you want to change the base?
Conversation
Bloop Bleep... Dogbot HereRegression Detector ResultsRun ID: 5c711bb9-a956-444f-a30d-ceddf6933a80 Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | file_tree | memory utilization | +0.09 | [-0.02, +0.19] |
➖ | idle | memory utilization | -0.07 | [-0.10, -0.05] |
➖ | file_to_blackhole | % cpu utilization | -0.51 | [-7.02, +6.00] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | otel_to_otel_logs | ingress throughput | +1.18 | [+0.44, +1.92] |
➖ | tcp_syslog_to_blackhole | ingress throughput | +0.48 | [+0.40, +0.55] |
➖ | process_agent_standard_check | memory utilization | +0.37 | [+0.31, +0.43] |
➖ | file_tree | memory utilization | +0.09 | [-0.02, +0.19] |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.06, +0.06] |
➖ | uds_dogstatsd_to_api | ingress throughput | -0.00 | [-0.03, +0.03] |
➖ | trace_agent_msgpack | ingress throughput | -0.03 | [-0.05, -0.02] |
➖ | trace_agent_json | ingress throughput | -0.03 | [-0.06, -0.00] |
➖ | process_agent_real_time_mode | memory utilization | -0.06 | [-0.10, -0.02] |
➖ | idle | memory utilization | -0.07 | [-0.10, -0.05] |
➖ | process_agent_standard_check_with_stats | memory utilization | -0.14 | [-0.19, -0.10] |
➖ | file_to_blackhole | % cpu utilization | -0.51 | [-7.02, +6.00] |
Explanation
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote a few comments which came to my mind when reading the code, I understand this needs to handle different languages so having a single perfect implementation is impossible, but I'm not sure this is the best way to do it 😄
EDIT: in particular I think this job only makes sense for the root go.mod
file, so the code could be way more specialized for that (only Go, only root module)
|
||
# Find the responsible person for each file | ||
owners = [] | ||
for root, _, files in os.walk(folder): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will walk down the tree recursively, and will enter different Go modules.
You might want to add a break
if there is a go.mod
file in the (sub)directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently assign to the "most retrieved owner" so parsing all the repo was on purpose. But you are right we might want more reviewers assigned teams (even if I'm not 100% sure in case of dependency issue, if we want it to be ignored we should tell it to dependabot in its configuration)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for Go dependencies, for non-root modules you should just use the Codeowner of the go.mod
file.
The root module doesn't have a Codeowner on purpose so I understand it doesn't work, but all other modules should have a narrower scope and be owned by (a) specific team(s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I prefer to stick with the ownership where the dependency is effectively imported, and I understand your point. Assigning to the owner of the go.mod
would mean we should not have a different ownership in the module, and I don't know if this is always true, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a quick look and it seems to me the single module for which it's not the case is test/new-e2e
.
All other modules (ignoring the root one) have a narrow scope and a specific owner.
tasks/assign_pr.py
Outdated
except StopIteration: | ||
label = "team/agent-platform" | ||
ctx.run(f"gh pr edit {pr_id} --remove-label \"team/triage\"") | ||
ctx.run(f"gh pr edit {pr_id} --add-label \"{label}\"") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to request review from those teams too ?
I know I usually don't look at PRs with my team's label (except just before freeze) but I do look at all PRs my team is assigned on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the role said we just have to assign a label to the correct team. We might want to clarify the process and responsabilities here as I've seen we have "just" 200+ dependabot PR opened which is a mess
with open(file_path, "r") as f: | ||
try: | ||
for line in f: | ||
if is_go_module(dependency): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better way to check if it's a go module is to check if the PR edits a go.mod
file.
You should probably add a check that the file is a go
or go.mod
file for this if
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CF comment above. Either I consider only the go.mod
file and I think it's not correct in terms of ownership, or I consider everything and so a pattern in the dependency looked like an acceptable approximation (knowing there is another match in the else)
|
||
# Find the responsible person for each file | ||
owners = [] | ||
for root, _, files in os.walk(folder): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't want a super specific implementation you might want to just use a grep
command to list files containing a given string, it would simplify this whole function
https://stackoverflow.com/a/16957078/10556221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree I use calls to gh
, meanwhile I'm not a super fan of python code calling too many external tools..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think calling grep
is pretty trivial, it doesn't have side effects or anything, it's just a very convenient tool
But up to you :)
dependabot updates all version of various dependencies. As a consequence it works also for github actions updates for instance |
@chouetz yes but workflows are owned by a specific team, so the PR will already be owned by that team. |
Yes the objective would also to rely only on CODEOWNERS as ownership definition. You can see in this PR dependabot set |
Oh ok I assumed for this kind of situation we just didn't set a label in the dependabot config and let the real code owner set its own team label, but I think I understand better what the goal of the PR is now |
…pendabot PR. Add an associated workflow to assign at PR creation
dfa84a5
to
c8be832
Compare
[Fast Unit Tests Report] On pipeline 37148540 (CI Visibility). The following jobs did not run any unit tests: Jobs:
If you modified Go files and expected unit tests to run in these jobs, please double check the job logs. If you think tests should have been executed reach out to #agent-developer-experience |
What does this PR do?
Motivation
Remove manual actions
Additional Notes
Possible Drawbacks / Trade-offs
Assignment is based on the occurrence of dependency found in repository files. This heuristic is basic and prevents the PR from being unassigned. It does not prevent a manual redirection.
Describe how to test/QA your changes
Reviewer's Checklist
Triage
milestone is set.major_change
label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.changelog/no-changelog
label has been applied.qa/skip-qa
label, with required eitherqa/done
orqa/no-code-change
labels, are applied.team/..
label has been applied, indicating the team(s) that should QA this change.need-change/operator
andneed-change/helm
labels have been applied.k8s/<min-version>
label, indicating the lowest Kubernetes version compatible with this feature.