Skip to content

fix: temporarily turn off badge increments #177

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

Merged
merged 3 commits into from
Aug 21, 2025
Merged
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
22 changes: 13 additions & 9 deletions src/api/tools/repoHandlers/GenericRepoHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
import { incrementRepoViewCount } from "../../utils/badge.js";
import rawMapping from "./generic/static-mapping.json";

const badgeCountAllowedRepos = ["mcp-ui", "git-mcp"];

class GenericRepoHandler implements RepoHandler {
name = "generic";
getTools(_: RepoData, env: any, ctx: any): Array<Tool> {
Expand Down Expand Up @@ -54,15 +56,17 @@ class GenericRepoHandler implements RepoHandler {
};
}

Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

Consider adding a TODO comment or ticket reference explaining when this code should be re-enabled, as this is described as a temporary change.

Suggested change
// TODO: Re-enable this code once the issue with incrementing repo view count is resolved.
// See ticket #12345 for details on the problem and the resolution plan.

Copilot uses AI. Check for mistakes.

ctx.waitUntil(
incrementRepoViewCount(
env as CloudflareEnvironment,
repo.owner,
repo.repo,
).catch((err) => {
console.error("Error incrementing repo view count:", err);
}),
);
if (badgeCountAllowedRepos.includes(repo.repo)) {
ctx.waitUntil(
incrementRepoViewCount(
env as CloudflareEnvironment,
repo.owner,
repo.repo,
).catch((err) => {
console.error("Error incrementing repo view count:", err);
}),
);
}

return {
content: [
Expand Down
Loading