Skip to content

Conversation

@xsaschako
Copy link
Member

@xsaschako xsaschako commented Aug 1, 2025

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • add bot

If need be, add additional information and what the reviewer should look out for in particular:

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation within the code (Doxygen) for new functionality has been added in the code
  • Appropriate external documentation (ReadTheDocs) for new functionality has been added to the online documentation
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

@xsaschako xsaschako linked an issue Aug 1, 2025 that may be closed by this pull request
2 tasks
@xsaschako xsaschako requested a review from mknaranja August 1, 2025 19:52
Copy link
Contributor

@HenrZu HenrZu left a comment

Choose a reason for hiding this comment

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

Very cool addition. I've added a few comments. We should discuss again that we have a workflow here that creates a PR with write permissions and also has access to the secrets.

And it would be great if you could add a few more comments so that the code has a little more structure. Maybe even move some functionalities to seperate files.

const monthlyData = [];
const now = new Date();

for (let i = 12; i >= 1; i--) {
Copy link
Contributor

Choose a reason for hiding this comment

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

rename i to month?

Copy link
Member Author

@xsaschako xsaschako Oct 8, 2025

Choose a reason for hiding this comment

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

as is used, month would be more confusing i think. i is fine i think

Comment on lines +384 to +389
const [stats, prStats, issueStats, releaseStats] = await Promise.all([
getSimpleMonthStats(since, until),
getPRStats(since, until),
getIssueStats(since, until),
getReleaseStats(since, until)
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

If i understand this correctly, we load the entire history here?
How long does this take?

Copy link
Member Author

Choose a reason for hiding this comment

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

... for the month. Certainly one of the most intensive tasks, but necessary

{ title: '🐛 Issues Opened', value: latest.issueStats.opened.toString(), short: true },
{ title: '✅ Issues Closed', value: latest.issueStats.closed.toString(), short: true },
],
text: `**🏆 Top Contributors:** ${latest.stats.contributorsList.slice(0, 5).join(', ') || 'None'}\n` +
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 the order here is random. So, this are not the top contributors.

Copy link
Member Author

Choose a reason for hiding this comment

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

true, also i think this is too competetive, ill just show the contributors

}
});

for (const commit of commits.slice(0, 30)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why only the first 30?

Copy link
Member Author

Choose a reason for hiding this comment

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

Github allows only a certain number of API calls. this is a safe value. i increased it to 50.

Comment on lines +20 to +21
- name: Checkout repository
uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is always necessary to get local variables and information of the rep

runs-on: ubuntu-latest
permissions:
contents: write
issues: write
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this used?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not anymore, i tried to make this bot do a PR, but that isnt allowed per GH

const monthLabels = monthlyData.map(d => d.month);

const charts = [
{ path: 'docs/stats/total-commits-chart.svg', content: createSVGChart(totalCommits, 'Total Commits', '#3b82f6', monthLabels) },
Copy link
Contributor

Choose a reason for hiding this comment

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

here, we mention 6 svg chart, but only 4 are part of this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

true, the new 6 are on the branch which needs to be merged

@HenrZu
Copy link
Contributor

HenrZu commented Oct 7, 2025

Also, please check the CI runs.

Copy link
Member Author

@xsaschako xsaschako left a comment

Choose a reason for hiding this comment

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

FOllowing options are available:

  1. This creates a branch -> manual PR ( no issue, as i think this would be too much overhead)
  2. This bot pushes directly to the main with permissions, and just updates the pictures (ok i think)

@mknaranja what do you say?

CI now runs fine, don't know why it says failed. Im against separate files as I don't see that we use a different bot with shared functionality and one file is then better. I'll think about comments, but the script structure forces a little bit more of a certain structure.

runs-on: ubuntu-latest
permissions:
contents: write
issues: write
Copy link
Member Author

Choose a reason for hiding this comment

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

It is not anymore, i tried to make this bot do a PR, but that isnt allowed per GH

Comment on lines +20 to +21
- name: Checkout repository
uses: actions/checkout@v4
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is always necessary to get local variables and information of the rep

}
});

for (const commit of commits.slice(0, 30)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Github allows only a certain number of API calls. this is a safe value. i increased it to 50.

const monthLabels = monthlyData.map(d => d.month);

const charts = [
{ path: 'docs/stats/total-commits-chart.svg', content: createSVGChart(totalCommits, 'Total Commits', '#3b82f6', monthLabels) },
Copy link
Member Author

Choose a reason for hiding this comment

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

true, the new 6 are on the branch which needs to be merged

const monthlyData = [];
const now = new Date();

for (let i = 12; i >= 1; i--) {
Copy link
Member Author

@xsaschako xsaschako Oct 8, 2025

Choose a reason for hiding this comment

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

as is used, month would be more confusing i think. i is fine i think

Comment on lines +384 to +389
const [stats, prStats, issueStats, releaseStats] = await Promise.all([
getSimpleMonthStats(since, until),
getPRStats(since, until),
getIssueStats(since, until),
getReleaseStats(since, until)
]);
Copy link
Member Author

Choose a reason for hiding this comment

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

... for the month. Certainly one of the most intensive tasks, but necessary

{ title: '🐛 Issues Opened', value: latest.issueStats.opened.toString(), short: true },
{ title: '✅ Issues Closed', value: latest.issueStats.closed.toString(), short: true },
],
text: `**🏆 Top Contributors:** ${latest.stats.contributorsList.slice(0, 5).join(', ') || 'None'}\n` +
Copy link
Member Author

Choose a reason for hiding this comment

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

true, also i think this is too competetive, ill just show the contributors

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.

New bot for monthly statistics

3 participants