Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/scripts/generate-rc-commits.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (!githubToken) {
// Initialize Octokit with your GitHub token
const octokit = new Octokit({ auth: githubToken });

// https://github.com/MetaMask/MetaMask-planning/blob/main/teams.json lookup from here
// https://github.com/MetaMask/MetaMask-planning/blob/main/topology.json lookup from here
async function getTeam(repository, prNumber) {
try {
const { data: prData } = await octokit.pulls.get({
Expand All @@ -26,7 +26,7 @@ async function getTeam(repository, prNumber) {
const author = prData.user.login; // PR author's GitHub username

const teamsJsonUrl =
'https://raw.githubusercontent.com/MetaMask/MetaMask-planning/refs/heads/main/teams.json';
'https://raw.githubusercontent.com/MetaMask/MetaMask-planning/refs/heads/main/topology.json';
const githubToken = process.env.GITHUB_TOKEN;

const response = await axios.get(teamsJsonUrl, {
Expand All @@ -36,7 +36,7 @@ async function getTeam(repository, prNumber) {
// Check if the response is successful and contains data
if (response.status !== 200 || !response.data) {
console.error(
`Invalid response when fetching teams.json: ${response.status}`,
`Invalid response when fetching topology.json: ${response.status}`,
Copy link

Choose a reason for hiding this comment

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

Bug: JSON structure mismatch causes all teams to return Unknown

The topology.json file has a different structure than the old teams.json. The new file is an array of team objects containing members, pm, em, tl, and githubLabel fields (as shown in .github/actions/add-team-label/action.yml). However, the code still uses teamsJson[author] which expects a flat object keyed by username. Since topology.json is an array and author is a username string, this lookup will always return undefined, causing all commits to be labeled as 'Unknown'.

Fix in Cursor Fix in Web

);
return ['Unknown'];
}
Expand Down
Loading