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

[dev-tools] Script to find recent top committers for a module #19053

Merged
merged 4 commits into from
Jun 25, 2020

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Jun 8, 2020

What does this PR do?

Adds a script, dev-tools/module_committers that finds a given module and lists out recent (within last year) top (3) committers for it.

Sample usages

Exact module name

$ ./dev-tools/module_committers o365                                                                                                                                                  
Found matching /Users/shaunak/go/src/github.com/elastic/beats/x-pack/filebeat/module/o365:
  Recent top committers:
  - Andrew Kroh
  - Adrian Serrano
  - Lee Hinman

Partial module name

$ ./dev-tools/module_committers 36
Found matching /Users/shaunak/go/src/github.com/elastic/beats/x-pack/filebeat/module/o365:
  Recent top committers:
  - Andrew Kroh
  - Adrian Serrano
  - Lee Hinman

Matching from multiple beats

$ ./dev-tools/module_committers kibana
Found matching /Users/shaunak/go/src/github.com/elastic/beats/metricbeat/module/kibana:
  Recent top committers:
  - Jaime Soriano Pastor
  - Shaunak Kashyap
  - Pablo Mercado
Found matching /Users/shaunak/go/src/github.com/elastic/beats/filebeat/module/kibana:
  Recent top committers:
  - Lee Hinman
  - Noémi Ványi
  - DeDe Morton

Why is it important?

It can be useful when trying to figure out who might know most about a module, particularly when triaging issues/PRs while on community duty or while handling tricky discuss posts or SDHs.

@ycombinator ycombinator added [zube]: In Review Team:Integrations Label for the Integrations team labels Jun 8, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 8, 2020

beats_base_dir=$(cd $(dirname $BASH_SOURCE)/..; pwd)

beat_dirs=$(find $beats_base_dir -type d -iname \*beat -maxdepth 2 | grep -v libbeat)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can wrap some lines into functions (find_beats_dirs, find_module_dirs, filter_module_name, etc.)

fi
done

for found_dir in $found_dirs; do
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if the script content above can be covered with a one–liner, e.g. find + xargs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, probably. I personally prefer to be more explicit like this when performance is not a huge consideration and readability is more important.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me! Readability on the first place.

@@ -0,0 +1,40 @@
#!/bin/bash

Copy link
Contributor

Choose a reason for hiding this comment

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

set -euxo pipefail ?

@ycombinator
Copy link
Contributor Author

@mtojek Thanks for the review. I've addressed your feedback. Please re-review when you get a chance!

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 11, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19053 updated]

  • Start Time: 2020-06-24T22:46:16.333+0000

  • Duration: 84 min 50 sec

Test stats 🧪

Test Results
Failed 0
Passed 9509
Skipped 1574
Total 11083

Steps errors

Expand to view the steps failures

  • Name: Report to Codecov
    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-06-24T23:15:22.891+0000

    • log

@ycombinator ycombinator merged commit 7db9959 into elastic:master Jun 25, 2020
@ycombinator ycombinator deleted the module-committers branch June 25, 2020 14:37
ycombinator added a commit to ycombinator/beats that referenced this pull request Jun 25, 2020
…c#19053)

* Init checkin

* Adding set

* Removing unnecessary variable

* Breaking up into functions
ycombinator added a commit that referenced this pull request Jun 26, 2020
#19395)

* Init checkin

* Adding set

* Removing unnecessary variable

* Breaking up into functions
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
…c#19053)

* Init checkin

* Adding set

* Removing unnecessary variable

* Breaking up into functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants