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

[LOGSC-1681] Add a check to validate that logs assets are owned by logs team #17185

Merged

Conversation

txominpelu
Copy link
Contributor

@txominpelu txominpelu commented Mar 14, 2024

What does this PR do?

After the migration of logs assets to the APW repos, we've had to update the github CODEOWNER files in all repos to make sure that logs assets for all integrations are owned by logs. With this PR we are adding a check to make sure that this condition is always met.

Motivation

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Changelog entries must be created for modifications to shipped code
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.

@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch from e4e36ab to 8362890 Compare March 15, 2024 14:28
@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch from 8362890 to 35492d6 Compare March 15, 2024 14:36
@datadog-agent-integrations-bot datadog-agent-integrations-bot bot added release qa/skip-qa Automatically skip this PR for the next QA labels Mar 15, 2024
Copy link

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch from 35492d6 to 678af31 Compare March 15, 2024 14:43
Copy link

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch 2 times, most recently from 6c7baf6 to d5e5642 Compare March 15, 2024 14:55
@txominpelu txominpelu changed the base branch from master to florentclarret/dcd/codeowners March 15, 2024 14:55
@FlorentClarret FlorentClarret force-pushed the florentclarret/dcd/codeowners branch from 0c8860e to 9245dbc Compare March 15, 2024 14:55
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 15.84158% with 85 lines in your changes are missing coverage. Please review.

Project coverage is 90.45%. Comparing base (4145d3e) to head (3706324).

Additional details and impacted files
Flag Coverage Δ
cassandra ?
confluent_platform ?
datadog_checks_dev 77.41% <15.84%> (+1.44%) ⬆️
hudi ?
kafka ?
solr ?
tomcat ?
weblogic ?

Flags with carried forward coverage won't be shown. Click here to find out more.

@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch from 75281f1 to d5e5642 Compare March 15, 2024 15:05
@FlorentClarret FlorentClarret force-pushed the florentclarret/dcd/codeowners branch from 9245dbc to ab8f0bf Compare March 15, 2024 15:48
Base automatically changed from florentclarret/dcd/codeowners to master March 15, 2024 15:57
@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch from d5e5642 to ca09e9d Compare March 15, 2024 16:17
@txominpelu txominpelu marked this pull request as ready for review March 15, 2024 16:18
@txominpelu txominpelu requested a review from a team as a code owner March 15, 2024 16:18
Copy link
Contributor

@iliakur iliakur left a comment

Choose a reason for hiding this comment

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

Thanks!

Just a couple small things.

@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch from 559972c to a4b3f32 Compare March 18, 2024 13:00
@iliakur
Copy link
Contributor

iliakur commented Mar 18, 2024

@txominpelu could you add a changelog entry and run ddev test -fs datadog_checks_dev.

@txominpelu
Copy link
Contributor Author

txominpelu commented Mar 18, 2024

@txominpelu could you add a changelog entry and run ddev test -fs datadog_checks_dev.

Sure, does this look good to you ?2fad0b3

I've also run the command that you've suggested but it's only changing files that I haven't touched.

Copy link

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

urseberry
urseberry previously approved these changes Mar 18, 2024
@txominpelu txominpelu force-pushed the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch from 027c445 to 5e1bf62 Compare March 18, 2024 22:01
Copy link

github-actions bot commented Mar 19, 2024

Test Results

  4 files    4 suites   3m 41s ⏱️
391 tests 391 ✅  0 💤 0 ❌
882 runs  849 ✅ 33 💤 0 ❌

Results for commit cc7deb8.

♻️ This comment has been updated with latest results.

@txominpelu txominpelu requested review from iliakur and urseberry and removed request for urseberry March 19, 2024 09:04
Comment on lines 95 to 96
codeowner_map = create_codeowners_map()

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
codeowner_map = create_codeowners_map()

That's initilialized in the if statement right after

if failed_integrations:
for integration in failed_integrations:
echo_failure(f"/{integration}/assets/logs/ is not owned by {LOGS_TEAM}")
abort()
Copy link
Member

@FlorentClarret FlorentClarret Mar 21, 2024

Choose a reason for hiding this comment

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

Suggested change
abort()
has_failed = True

I would drop it so we can go through the rest of the validation after :)

echo_success("All integrations have valid logs codeowners.")

codeowner_map = create_codeowners_map()

has_failed = False
Copy link
Member

Choose a reason for hiding this comment

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

and thus move this to the top 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean to the bottom ? Like, this commit: cc7deb8

Copy link
Member

Choose a reason for hiding this comment

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

I meant has_failed = False, so it works if you put your code at the bottom 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

aaaah, haha. Makes sense, I did it even if I had not fully understood your comment :P

Copy link
Contributor

@iliakur iliakur left a comment

Choose a reason for hiding this comment

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

Just one small request, otherwise lgtm!

@FlorentClarret FlorentClarret enabled auto-merge (squash) March 21, 2024 11:56
@FlorentClarret FlorentClarret merged commit 1e82fcb into master Mar 21, 2024
42 checks passed
@FlorentClarret FlorentClarret deleted the inigo.mediavilla/enforce_logs_owners_for_logs_assets branch March 21, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants