Skip to content

Initial contributor activity data collection pipeline - #1

Merged
Piinks merged 6 commits into
flutter:mainfrom
Piinks:dataFlow
Aug 4, 2026
Merged

Initial contributor activity data collection pipeline#1
Piinks merged 6 commits into
flutter:mainfrom
Piinks:dataFlow

Conversation

@Piinks

@Piinks Piinks commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Adds workflows for collecting contributor data on a rolling basis. This will make quarterly analysis much much easier.
Part of flutter/flutter#186415

How to review this PR:

Everything under data/ is a year's worth of contributor data. You can skim it, but it is all generated by the other contents of this PR, where the review should focus. :)

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Piinks added 2 commits August 3, 2026 15:01
…coverage

- Make weekly activity synchronization idempotent, querying week-to-date
- Deduplicate PR review credits per merged pull request
- Fix ISO 8601 week number and year-boundary calculations
- Prune 52-week rolling window based on filename ISO week rather than runner mtime
- Eliminate bot false positives for human usernames ending with bot
- Support ORG_READ_TOKEN in CI and client injection for unit tests
- Sort contributor keys alphabetically in summary and weekly files
- Add analysis_options.yaml and dart format check in validate.yml
- Add unit tests for ISO weeks, sync logic, data integrity, and GitHubClient
Comment thread tool/bots.dart Outdated
Comment thread tool/github.dart
Comment thread tool/github.dart
Comment thread tool/bots.dart
Comment on lines +65 to +71
if (lower.endsWith('[bot]') ||
lower.endsWith('-bot') ||
lower.endsWith('_bot') ||
lower.contains('autoroll') ||
lower.contains('robot')) {
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This might exclude contributions from someone whose login happens to contain robot. Is the knownBots list enough? (The [bot] check seems reasonable though since that'll never match a user login!)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I feel like I should remove -bot and _bot in addition to robot. I am thinking some one like bell_bottom would get caught, or like cheers-bottoms-up, or aRbitraRy-botSomEthing. 😜

Bots should be part of the Robots Github team, but I am sure there are some gaps there. I can iterate on this as well as we 'work the ladder'.

@Piinks Piinks Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Err no, I confused myself. It's only checking endsWith on those ones, so maybe ok. I will leave them. I was still looking at the contains('robot')

@loic-sharma loic-sharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me with some minor nitpicks!

@Piinks
Piinks requested a review from jtmcdole August 3, 2026 23:13
Piinks added 2 commits August 3, 2026 18:15
…put validation

- Handle deleted account ghost separately from isBot via isGhost and isExcludedAccount
- Remove lower.contains('robot') to prevent false-positives for human usernames
- Implement rate limit retry handling with Retry-After header and backoff in GitHubClient
- Validate GitHub usernames in user activity queries to protect against query injection
- Add unit tests for ghost handling, robot usernames, rate limit retries, and username validation

@justinmc justinmc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 👍

Comment thread docs/DATA_PIPELINE.md
### Exclusions and filtering

- Accounts in the `@flutter/robots` GitHub team and known automation usernames defined in `tool/bots.dart` are excluded.
- Members of `@flutter/googlers` and `@flutter/partners` are excluded to conserve GitHub API rate limits.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I see ex-Googlers in the data. Maybe it's not worth the hassle of excluding them though, since the problem will resolve itself after 52 weeks.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I do have some special handling coming in the full implementation. I'll have a doc out for review on that soon.

Comment thread tool/sync_activity.dart
partners = await client.getTeamMembers('flutter', 'partners');
await loadRobotsTeam(client);
} catch (_) {
// Elevated team read permissions may not be available with default GITHUB_TOKEN

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: Should anything be logged in this case? And/or should you only catch the specific type of error that the comment suggests here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good call - updated all catch (_) where we don't want to throw to add logging. 👍

Comment thread CONTRIBUTING.md
=======================

_tl;dr: join [Discord](./docs/contributing/Chat.md), be [courteous](CODE_OF_CONDUCT.md), follow the steps below to set up a development environment; if you stick around and contribute, you can [join the team](./docs/contributing/Contributor-access.md) and get commit access._
_tl;dr: join [Discord](https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md), be [courteous](https://github.com/flutter/flutter/blob/main/CODE_OF_CONDUCT.md), follow the steps below to set up a development environment; if you stick around and contribute, you can [join the team](https://github.com/flutter/flutter/blob/main/docs/contributing/Contributor-access.md) and get commit access._

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I guess this was copied from flutter/flutter and the links didn't work?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yup. Kevin originally just copied the file over from flutter/flutter when the repo was set up, so the links were all relative.

@Piinks
Piinks merged commit f8b4c40 into flutter:main Aug 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants