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

new personal Fork #2

Open
wants to merge 120 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
2fdae7d
chore: add Raphael De Lio to AMBASSADORS_MEMBERS.json (#1298)
raphaeldelio Jun 27, 2024
dbef72b
chore: add Hari Krishnan to AMBASSADORS_MEMBERS.json (#1299)
harikrishnan83 Jun 28, 2024
c54f40e
chore(tweet): recurring tweet about slack link (#1300)
asyncapi-bot Jun 29, 2024
d84e239
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Jul 1, 2024
f080bb2
chore: cleanup TSC list (#1291)
derberg Jul 1, 2024
09d0b29
docs: clarify jurisdiction of the CoC Committee regarding Slack exter…
smoya Jul 4, 2024
504b802
chore(tweet): recurring tweet about slack link (#1303)
asyncapi-bot Jul 6, 2024
53a6e92
docs: project donation (#1289)
AceTheCreator Jul 8, 2024
a107acf
chore: update ambassadors profile (#1308)
thulieblack Jul 11, 2024
ae526ac
chore: update AMBASSADORS_MEMBERS.json (#1310)
thulieblack Jul 12, 2024
e013e93
chore(tweet): recurring tweet about slack link (#1312)
asyncapi-bot Jul 13, 2024
b504ef4
docs: added mentor/mentees (#1307)
AceTheCreator Jul 15, 2024
164fd3f
fix: update invalid GitHub username for Alejandra Quetzalli (#1314)
mszostok Jul 20, 2024
7cbf9da
chore(tweet): recurring tweet about slack link (#1316)
asyncapi-bot Jul 20, 2024
cb018e7
chore: update the github username of tsc member (#1318)
AayushSaini101 Jul 22, 2024
78045b3
chore: update usernames for maintainers (#1320)
AayushSaini101 Jul 23, 2024
39e05c2
feat: add new worklow to track the voting process (#1278)
AayushSaini101 Jul 23, 2024
bcff426
chore: vote tracking details (#1323)
asyncapi-bot Jul 24, 2024
3100867
fix: fix undefined error and remove unused files (#1325)
AayushSaini101 Jul 26, 2024
3a2c2c4
chore: vote tracking details (#1326)
asyncapi-bot Jul 26, 2024
d0e05d7
chore(tweet): recurring tweet about slack link (#1327)
asyncapi-bot Jul 27, 2024
325646b
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Aug 1, 2024
2c27885
chore(tweet): recurring tweet about slack link (#1334)
asyncapi-bot Aug 3, 2024
5ca89ed
chore(tweet): recurring tweet about slack link (#1341)
asyncapi-bot Aug 10, 2024
43cdbf2
feat: add manuelottlik to ambassadors (#1343)
manuelottlik Aug 14, 2024
540ded1
chore(tweet): recurring tweet about slack link (#1347)
asyncapi-bot Aug 17, 2024
502b721
docs: update README.md (#1348)
AceTheCreator Aug 19, 2024
1c2f236
ci: update MAINTAINERS.yaml for each CODEOWNERS file change (#1315)
mszostok Aug 21, 2024
81eb1a6
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Aug 21, 2024
2c75f98
chore(tweet): recurring tweet about slack link (#1352)
asyncapi-bot Aug 24, 2024
fe4d0a6
chore(tweet): recurring tweet about slack link (#1364)
asyncapi-bot Aug 31, 2024
a01cb71
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Sep 1, 2024
ddd8d1d
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Sep 1, 2024
aff9fed
feat: add Lorna to the ambassadors' (#1367)
lornajane Sep 2, 2024
7426767
fix: add missing img (#1368)
thulieblack Sep 2, 2024
46c40f0
chore(tweet): recurring tweet about slack link (#1369)
asyncapi-bot Sep 7, 2024
44e06d6
chore(tweet): recurring tweet about slack link (#1374)
asyncapi-bot Sep 14, 2024
40fbc0e
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Sep 15, 2024
dbfa29c
chore(tweet): recurring tweet about slack link (#1530)
asyncapi-bot Sep 21, 2024
85a5f0d
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Sep 22, 2024
b282248
chore(tweet): recurring tweet about slack link (#1538)
asyncapi-bot Sep 28, 2024
e86356b
fix(COC): typo in email address in Enforcement section (#1537)
bandantonio Oct 1, 2024
99ea02f
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Oct 1, 2024
742718f
chore(tweet): recurring tweet about slack link (#1548)
asyncapi-bot Oct 5, 2024
58f4692
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Oct 6, 2024
7399758
chore(tweet): recurring tweet about slack link (#1556)
asyncapi-bot Oct 12, 2024
2030d65
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Oct 13, 2024
59bc24c
chore(tweet): recurring tweet about slack link (#1560)
asyncapi-bot Oct 19, 2024
b09a874
ci: update CODEOWNERS for coc stuff (#1565)
smoya Oct 23, 2024
0a5a5cc
chore: update coc doc (#1563)
thulieblack Oct 23, 2024
d202b25
chore(tweet): recurring tweet about slack link (#1568)
asyncapi-bot Oct 26, 2024
886f6bf
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Nov 1, 2024
24505c0
chore(tweet): recurring tweet about slack link (#1573)
asyncapi-bot Nov 2, 2024
9714a62
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Nov 3, 2024
e39e022
chore: update postman info (#1576)
derberg Nov 8, 2024
796c272
chore(tweet): recurring tweet about slack link (#1583)
asyncapi-bot Nov 9, 2024
31c04b0
feat: added ashmit-coder in Maintainers.yml (#1585)
ashmit-coder Nov 11, 2024
cb06aaa
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Nov 12, 2024
8a08fa1
chore: update TSC and Ambassadors list (#1590)
derberg Nov 14, 2024
6648a56
chore(tweet): recurring tweet about slack link (#1591)
asyncapi-bot Nov 16, 2024
901cb55
chore: vote tracking details (#1593)
asyncapi-bot Nov 19, 2024
d8aad96
chore: update mentorship doc (#1580)
thulieblack Nov 22, 2024
e5f322a
chore(tweet): recurring tweet about slack link (#1597)
asyncapi-bot Nov 23, 2024
d0d0921
chore(tweet): recurring tweet about slack link (#1604)
asyncapi-bot Nov 30, 2024
24d75ea
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Dec 1, 2024
9df5f5f
docs: add 2024 mentorship directory (#1601)
AceTheCreator Dec 2, 2024
d761eef
chore: vote tracking details (#1611)
asyncapi-bot Dec 3, 2024
46a357b
chore(tweet): recurring tweet about slack link (#1613)
asyncapi-bot Dec 7, 2024
80948df
docs: actualize link to AMBASSADORS_MEMBERS in AMBASSADOR_ORGANIZATIO…
Lancetnik Dec 10, 2024
0a84ba3
chore(tweet): recurring tweet about slack link (#1617)
asyncapi-bot Dec 14, 2024
a13aa4c
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Dec 15, 2024
3fe011c
docs: update contributions under Hari Krishnan in Ambassadors list (#…
harikrishnan83 Dec 17, 2024
2953f77
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Dec 20, 2024
5a3b493
chore(tweet): recurring tweet about slack link (#1625)
asyncapi-bot Dec 21, 2024
599b479
chore(tweet): recurring tweet about slack link (#1628)
asyncapi-bot Dec 28, 2024
5d4ab4c
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Jan 1, 2025
8f07f23
chore(tweet): recurring tweet about slack link (#1631)
asyncapi-bot Jan 4, 2025
b89a372
chore: add AsyncAPI Community Building Goals 2025 Proposal (#1575)
thulieblack Jan 9, 2025
7e3c25e
chore: update Quetzalli's name on the CODEOWNERS file (#1586)
thulieblack Jan 9, 2025
242147a
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Jan 9, 2025
06df34b
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Jan 9, 2025
da64a70
chore(tweet): recurring tweet about slack link (#1640)
asyncapi-bot Jan 11, 2025
a93fbe0
chore: add AayushSaini101 to TSC as maintainer of cli (#1637)
AayushSaini101 Jan 13, 2025
98fa025
chore: update Ambassador list (#1642)
thulieblack Jan 15, 2025
10893f8
chore(tweet): recurring tweet about slack link (#1651)
asyncapi-bot Jan 18, 2025
c2b1781
feat: add @Maya in zoom meeting managers (#1648)
ashmit-coder Jan 20, 2025
d747423
chore: remove old TSC_MEMBERS.json file (#1656)
fmvilas Jan 20, 2025
4b9149f
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Jan 21, 2025
5d6454e
docs: update MAINTAINERS.yaml file with isTscMember: true for Hari Kr…
harikrishnan83 Jan 22, 2025
4adc205
chore(tweet): recurring tweet about slack link (#1662)
asyncapi-bot Jan 25, 2025
475ae05
docs: update the mentorships numbers (#1349)
AceTheCreator Jan 28, 2025
dc146d4
feat: docs automation for website (#1082)
AnimeshKumar923 Jan 29, 2025
656cb2e
chore: update AMBASSADORS_MEMBERS.json (#1667)
thulieblack Jan 30, 2025
2be75a6
fix: terraform setup added (#1665)
neoandmatrix Jan 30, 2025
096b78e
feat: update docs automation (#1672)
thulieblack Jan 30, 2025
414bfde
ci: fix docs update workflow (#1673)
thulieblack Jan 30, 2025
eb5ed00
chore(tweet): recurring tweet about discussion tools ideas in our dis…
asyncapi-bot Feb 1, 2025
0863782
chore(tweet): recurring tweet about slack link (#1676)
asyncapi-bot Feb 1, 2025
ab03022
docs: add proposed project ideas to mentorship directory (#1609)
SaxenaAnushka102 Feb 4, 2025
a6db28c
fix: slack ID made optional. (#1677)
neoandmatrix Feb 4, 2025
27db3e9
docs: fix internal docs link format (#1679)
thulieblack Feb 4, 2025
d2baf55
ci: update docs paths (#1680)
thulieblack Feb 5, 2025
300c573
docs: fix path links (#1682)
thulieblack Feb 6, 2025
bab8783
chore(tweet): recurring tweet about slack link (#1703)
asyncapi-bot Feb 8, 2025
1f80fcb
docs: add GSoC 2025 project ideas (#1706)
AceTheCreator Feb 11, 2025
65212dd
ci: fix HTTP `PUT` request to the GitHub REST API (#1664)
aeworxet Feb 11, 2025
f065f9f
chore: update @Souvikns company status and fixing verification workfl…
Souvikns Feb 11, 2025
053e240
feat: add website GSoC 2025 ideas (#1714)
akshatnema Feb 11, 2025
a8175b0
ci: update process of passing auth token (#1715)
aeworxet Feb 12, 2025
516142d
ci: add workflow for automated vote notification (#1337)
Shurtu-gal Feb 12, 2025
47b06c0
docs: add Shurtu-gal as a contributor for infra, review, and 3 more (…
allcontributors[bot] Feb 12, 2025
96a51be
fix: fix incorrect project idea link fo vscode extension (#1720)
AceTheCreator Feb 12, 2025
5e7c6b5
docs(maintainers): update MAINTAINERS.yaml file with the latest CODEO…
asyncapi-bot Feb 14, 2025
d5a1564
chore(tweet): recurring tweet about slack link (#1723)
asyncapi-bot Feb 15, 2025
876478b
ci: update of files from global .github repo (#1728)
asyncapi-bot Feb 17, 2025
df8626f
ci: minor fixes to the maintainers management workflow (#1729)
aeworxet Feb 17, 2025
65a4a4d
chore: add TRohit20(Self) to TSC as maintainer of website (#1724)
TRohit20 Feb 17, 2025
bcb402b
ci: minor fixes to the TSC management workflow (#1734)
aeworxet Feb 19, 2025
2cd8a6f
chore: vote tracking details (#1751)
asyncapi-bot Feb 21, 2025
420a541
chore(tweet): recurring tweet about slack link (#1752)
asyncapi-bot Feb 22, 2025
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
13 changes: 13 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,19 @@
"blog",
"promotion"
]
},
{
"login": "Shurtu-gal",
"name": "Ashish Padhy",
"avatar_url": "https://avatars.githubusercontent.com/u/100484401?v=4",
"profile": "http://ashishpadhy.live",
"contributions": [
"infra",
"review",
"question",
"ideas",
"maintenance"
]
}
],
"commitConvention": "angular",
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/maintainers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github.api.cache.json
58 changes: 58 additions & 0 deletions .github/scripts/maintainers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Maintainers

The ["Update MAINTAINERS.yaml file"](../../workflows/update-maintainers.yaml) workflow, defined in the `community` repository performs a complete refresh by fetching all public repositories under AsyncAPI and their respective `CODEOWNERS` files.

## Workflow Execution

The "Update MAINTAINERS.yaml file" workflow is executed in the following scenarios:

1. **Weekly Schedule**: The workflow runs automatically every week. It is useful, e.g. when some repositories are archived, renamed, or when a GitHub user account is removed.
2. **On Change**: When a `CODEOWNERS` file is changed in any repository under the AsyncAPI organization, the related repository triggers the workflow by emitting the `trigger-maintainers-update` event.
3. **Manual Trigger**: Users can manually trigger the workflow as needed.

### Workflow Steps

1. **Load Cache**: Attempt to read previously cached data from `github.api.cache.json` to optimize API calls.
2. **List All Repositories**: Retrieve a list of all public repositories under the AsyncAPI organization, skipping any repositories specified in the `IGNORED_REPOSITORIES` environment variable.
3. **Fetch `CODEOWNERS` Files**: For each repository:
- Detect the default branch (e.g., `main`, `master`, or a custom branch).
- Check for `CODEOWNERS` files in all valid locations as specified in the [GitHub documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location).
4. **Process `CODEOWNERS` Files**:
1. Extract GitHub usernames from each `CODEOWNERS` file, excluding emails, team names, and users specified by the `IGNORED_USERS` environment variable.
2. Retrieve profile information for each unique GitHub username.
3. Collect a fresh list of repositories currently owned by each GitHub user.
5. **Refresh Maintainers List**: Iterate through the existing maintainers list:
- Delete the entry if it:
- Refers to a deleted GitHub account.
- Was not found in any `CODEOWNERS` file across all repositories in the AsyncAPI organization.
- Otherwise, update **only** the `repos` property.
6. **Add New Maintainers**: Append any new maintainers not present in the previous list.
7. **Changes Summary**: Provide details on why a maintainer was removed or changed directly on the GitHub Action [summary page](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/).
8. **Save Cache**: Save retrieved data in `github.api.cache.json`.

## Job Details

- **Concurrency**: Ensures the workflow does not run multiple times concurrently to avoid conflicts.
- **Wait for PRs to be Merged**: The workflow waits for pending pull requests to be merged before execution. If the merged pull request addresses all necessary fixes, it prevents unnecessary executions.

## Handling Conflicts

Since the job performs a full refresh each time, resolving conflicts is straightforward:

1. Close the pull request with conflicts.
2. Navigate to the "Update MAINTAINERS.yaml file" workflow.
3. Trigger it manually by clicking "Run workflow".

## Caching Mechanism

Each execution of this action performs a full refresh through the following API calls:

```
ListRepos(AsyncAPI) # 1 call using GraphQL - not cached.
for each Repo
GetCodeownersFile(Repo) # N calls using REST API - all are cached. N refers to the number of public repositories under AsyncAPI.
for each codeowner
GetGitHubProfile(owner) # Y calls using REST API - all are cached. Y refers to unique GitHub users found across all CODEOWNERS files.
```

To avoid hitting the GitHub API rate limits, [conditional requests](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate) are used via `if-modified-since`. The API responses are saved into a `github.api.cache.json` file, which is later uploaded as a GitHub action cache item.
64 changes: 64 additions & 0 deletions .github/scripts/maintainers/cache.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const fs = require("fs");

module.exports = {
fetchWithCache,
saveCache,
loadCache,
printAPICallsStats,
};

const CODEOWNERS_CACHE_PATH = "./.github/scripts/maintainers/github.api.cache.json";

let cacheEntries = {};

let numberOfFullFetches = 0;
let numberOfCacheHits = 0;

function loadCache(core) {
try {
cacheEntries = JSON.parse(fs.readFileSync(CODEOWNERS_CACHE_PATH, "utf8"));
} catch (error) {
core.warning(`Cache was not restored: ${error}`);
}
}

function saveCache() {
fs.writeFileSync(CODEOWNERS_CACHE_PATH, JSON.stringify(cacheEntries));
}

async function fetchWithCache(cacheKey, fetchFn, core) {
const cachedResp = cacheEntries[cacheKey];

try {
const { data, headers } = await fetchFn({
headers: {
"if-modified-since": cachedResp?.lastModified ?? "",
},
});

cacheEntries[cacheKey] = {
// last modified header is more reliable than etag while executing calls on GitHub Action
lastModified: headers["last-modified"],
data,
};

numberOfFullFetches++;
return data;
} catch (error) {
if (error.status === 304) {
numberOfCacheHits++;
core.debug(`Returning cached data for ${cacheKey}`);
return cachedResp.data;
}
throw error;
}
}

function printAPICallsStats(core) {
core.startGroup("API calls statistic");
core.info(
`Number of API calls count against rate limit: ${numberOfFullFetches}`,
);
core.info(`Number of cache hits: ${numberOfCacheHits}`);
core.endGroup();
}
131 changes: 131 additions & 0 deletions .github/scripts/maintainers/gh_calls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
const { fetchWithCache } = require("./cache");

module.exports = { getGitHubProfile, getAllCodeownersFiles, getRepositories };

async function getRepositories(github, owner, ignoredRepos, core) {
core.startGroup(
`Getting list of all public, non-archived repositories owned by ${owner}`,
);

const query = `
query repos($cursor: String, $owner: String!) {
organization(login: $owner) {
repositories(first: 100 after: $cursor visibility: PUBLIC isArchived: false orderBy: {field: CREATED_AT, direction: ASC} ) {
nodes {
name
}
pageInfo {
hasNextPage
endCursor
}
}
}
}`;

const repos = [];
let cursor = null;

do {
const result = await github.graphql(query, { owner, cursor });
const { nodes, pageInfo } = result.organization.repositories;
repos.push(...nodes);

cursor = pageInfo.hasNextPage ? pageInfo.endCursor : null;
} while (cursor);

core.debug(`List of repositories for ${owner}:`);
core.debug(JSON.stringify(repos, null, 2));
core.endGroup();

return repos.filter((repo) => !ignoredRepos.includes(repo.name));
}

async function getGitHubProfile(github, login, core) {
try {
const profile = await fetchWithCache(
`profile:${login}`,
async ({ headers }) => {
return github.rest.users.getByUsername({
username: login,
headers,
});
},
core,
);
return removeNulls({
name: profile.name ?? login,
github: login,
twitter: profile.twitter_username,
availableForHire: profile.hireable,
isTscMember: false,
repos: [],
githubID: profile.id,
});
} catch (error) {
if (error.status === 404) {
return null;
}
throw error;
}
}

// Checks for all valid locations according to:
// https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location
//
// Detect the repository default branch automatically.
async function getCodeownersFile(github, owner, repo, core) {
const paths = ["CODEOWNERS", "docs/CODEOWNERS", ".github/CODEOWNERS"];

for (const path of paths) {
try {
core.debug(
`[repo: ${owner}/${repo}]: Fetching CODEOWNERS file at ${path}`,
);
return await fetchWithCache(
`owners:${owner}/${repo}`,
async ({ headers }) => {
return github.rest.repos.getContent({
owner,
repo,
path,
headers: {
Accept: "application/vnd.github.raw+json",
...headers,
},
});
},
core,
);
} catch (error) {
core.warning(
`[repo: ${owner}/${repo}]: Failed to fetch CODEOWNERS file at ${path}: ${error.message}`,
);
}
}

core.error(
`[repo: ${owner}/${repo}]: CODEOWNERS file not found in any of the expected locations.`,
);
return null;
}

async function getAllCodeownersFiles(github, owner, repos, core) {
core.startGroup(`Fetching CODEOWNERS files for ${repos.length} repositories`);
const files = [];
for (const repo of repos) {
const data = await getCodeownersFile(github, owner, repo.name, core);
if (!data) {
continue;
}
files.push({
repo: repo.name,
content: data,
});
}
core.endGroup();
return files;
}

function removeNulls(obj) {
return Object.fromEntries(Object.entries(obj).filter(([_, v]) => v != null));
}
Loading
Loading