Skip to content

Comments

Feat/install atcoder heatmap#51

Draft
zerozero-0-0 wants to merge 6 commits intomainfrom
feat/install_atcoder_heatmap
Draft

Feat/install atcoder heatmap#51
zerozero-0-0 wants to merge 6 commits intomainfrom
feat/install_atcoder_heatmap

Conversation

@zerozero-0-0
Copy link
Owner

No description provided.

@zerozero-0-0 zerozero-0-0 requested a review from Copilot December 8, 2025 09:23
@zerozero-0-0 zerozero-0-0 self-assigned this Dec 8, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 8, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
portfolio 46ee7eb Dec 11 2025, 05:50 AM

@zerozero-0-0
Copy link
Owner Author

@codex review

@gemini-code-assist
Copy link

Summary of Changes

Hello @zerozero-0-0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new feature to collect and store AtCoder submission data, likely as a foundational step for displaying an activity heatmap. It also includes an update to the GitHub API request headers used within the project's worker, ensuring proper interaction with the GitHub API.

Highlights

  • AtCoder Data Collection Script: A new script has been added to fetch daily AtCoder Accepted (AC) submission counts for a specified user and store them in Cloudflare KV for persistent storage.
  • GitHub API Header Update: The GitHub API request headers in worker/index.ts have been updated to use a more general Accept header and explicitly specify the 2022-11-28 API version, ensuring compatibility with the latest GitHub API practices.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new GitHub script to fetch AtCoder submission data and store it in Cloudflare KV, and also updates GitHub API headers in the Cloudflare worker. The changes to the worker are good, aligning with current GitHub API best practices.

My review of the new script has identified a few areas for improvement to enhance its robustness and correctness:

  • Environment Variable Validation: The script should validate all required environment variables at startup.
  • Date Calculation: There's an issue with how the 'from' timestamp is calculated, which could lead to incomplete data fetching.
  • Error Handling: The script incorrectly treats a valid empty submission history as an error.
  • Code Style: A suggestion is provided to make part of the code more concise.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for tracking AtCoder problem submissions by introducing a new data collection script and updating the GitHub API headers to use the current API version specification.

  • Adds a new script to fetch and store daily AtCoder submission counts in Cloudflare KV
  • Updates GitHub API headers to use the modern format with explicit API version
  • Sets up infrastructure for displaying AtCoder problem-solving activity (heatmap functionality)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
worker/index.ts Updates GitHub API headers to use modern application/vnd.github+json format and adds explicit API version 2022-11-28
.github/scripts/update-atcoder-problems-data.mjs Adds new script to fetch yesterday's AtCoder AC submissions and store the count in Cloudflare KV for heatmap visualization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zerozero-0-0
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +11 to +12
const CACHE_KEY_PREFIX = "atcoder-problems-submission";
const STALE_THRESHOLD_MS = 1000 * 60 * 60 * 24 * 14; // 14 days

Choose a reason for hiding this comment

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

P1 Badge AtCoder problems fetcher looks under wrong KV key

The new AtCoder Problems cache reader builds its cache key with the atcoder-problems-submission prefix (CACHE_KEY_PREFIX), but both the init/update scripts write the heatmap payload to atcoder-problems-data:${username} (.github/scripts/init-atcoder-problems-data.mjs lines 1-9). Because the prefixes differ, the fetcher will never find the populated KV value and will always return {ok: false, rating: null}, so the new heatmap data cannot be served even after initialization.

Useful? React with 👍 / 👎.

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.

1 participant