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

docs: Centralize Author/Team Mapping for Commit Tracking #25986

Merged
merged 8 commits into from
Jul 24, 2024

Conversation

benjisclowder
Copy link
Contributor

@benjisclowder benjisclowder commented Jul 19, 2024

This PR removes mapping from public repository and utilizing the team mapping centralized in a private repository, further maintaining author/team mapping in a single, unified location.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/extension-delivery/issues/271

@benjisclowder benjisclowder added the area-documentation Issues relating to documentation, in the codebase and off. label Jul 19, 2024
@benjisclowder benjisclowder requested review from kumavis and a team as code owners July 19, 2024 17:07
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added INVALID-PR-TEMPLATE PR's body doesn't match template team-extension-platform labels Jul 19, 2024
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.67%. Comparing base (003ee98) to head (f080167).
Report is 20 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #25986    +/-   ##
=========================================
  Coverage    69.67%   69.67%            
=========================================
  Files         1400     1401     +1     
  Lines        49510    49628   +118     
  Branches     13689    13713    +24     
=========================================
+ Hits         34494    34577    +83     
- Misses       15016    15051    +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [782fad7]
Page Load Metrics (69 ± 8 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint69137100168
domContentLoaded105925126
load4710269178
domInteractive105925126
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

@metamaskbot
Copy link
Collaborator

Builds ready [f080167]
Page Load Metrics (144 ± 158 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint711831052713
domContentLoaded97728157
load391578144330158
domInteractive97728157
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

console.log('Generation of the CSV file "commits.csv" is in progress...');

for (const commit of log.all) {
const { author, message, hash } = commit;
if (commitsByTeam.length >= MAX_COMMITS) {
if (processedCommits >= MAX_COMMITS) {
Copy link
Contributor

@chloeYue chloeYue Jul 23, 2024

Choose a reason for hiding this comment

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

Tested and found the current commitsByTeam.length >= MAX_COMMITSdoes not work because commitsByTeam is a object, not a Map, so it doesn't have a size property. We should track the number of processed commits by processedCommits.

return team;
}
// Function to get the GitHub username for a given commit hash
async function getGitHubUsername(commitHash) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the teams.json file, the PR author's username (handle) is used, so we need to retrieve the username instead of the author's name from the commit log.

@hjetpoluru
Copy link
Contributor

Thanks @chloeYue for taking it up. I believe we can simplify the process here. When fetching the commits, we already obtain the author's information, as shown in the example below. Therefore, we don't need the fetchAuthorTeamsFile and getGitHubUsername functions. This will significantly reduce the number of Git calls. Additionally, we need the team label, which can be achieved by modifying the getPRLabels function to trim the 'team-' prefix and include it in the cvs file. Let me know if you need any help or clarification.

 {
      message: 'fix: token detection and import (#23798) (#23871)',
      author: 'Brian Bergeron',
      prLink: 'https://github.com/MetaMask/metamask-extension/pull/23798',
      releaseLabel: 'release-11.15.0',
      hash: '6ac918d005'
    }

@hjetpoluru hjetpoluru self-requested a review July 23, 2024 20:21
@chloeYue
Copy link
Contributor

chloeYue commented Jul 24, 2024

Thanks @chloeYue for taking it up. I believe we can simplify the process here. When fetching the commits, we already obtain the author's information, as shown in the example below. Therefore, we don't need the fetchAuthorTeamsFile and getGitHubUsername functions. This will significantly reduce the number of Git calls. Additionally, we need the team label, which can be achieved by modifying the getPRLabels function to trim the 'team-' prefix and include it in the cvs file. Let me know if you need any help or clarification.

 {
      message: 'fix: token detection and import (#23798) (#23871)',
      author: 'Brian Bergeron',
      prLink: 'https://github.com/MetaMask/metamask-extension/pull/23798',
      releaseLabel: 'release-11.15.0',
      hash: '6ac918d005'
    }

Hi @hjetpoluru, thanks for your review. We do need the fetchAuthorTeamsFile function because it's necessary to retrieve the teams.json file for author/team mapping. Also, as you can see in your comment, the author's name is displayed, but in the teams.json mapping file, we use GitHub username (handle), which often differ from the author's name. That's why we need to fetch the handle to ensure accurate mapping. Please refer to my comment in this PR for further clarification. For the team label, we've opted for an author/team mapping approach, allowing each feature team to validate PRs from their own members. we don't rely solely on PR labels because this would mean feature teams would need to validate PRs that affect their code but might not originate from their team. Additionally, a PR can be associated with multiple team labels, complicating the validation process. The current approache need more git call but as this script is only executed once per release so i guess it's ok.

@chloeYue chloeYue merged commit ed7f9e6 into develop Jul 24, 2024
79 checks passed
@chloeYue chloeYue deleted the fix-generate-rc-commits branch July 24, 2024 14:56
@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-documentation Issues relating to documentation, in the codebase and off. INVALID-PR-TEMPLATE PR's body doesn't match template release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants