LearnNewsExamplesServices
Frontmatter
id7619
titleRefactor Magic Number for Release Fetching Pagination
stateClosed
labels
enhancementairefactoring
assigneestobiu
createdAtOct 23, 2025, 1:35 PM
updatedAtOct 23, 2025, 1:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/7619
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtOct 23, 2025, 1:38 PM

Refactor Magic Number for Release Fetching Pagination

Closed v11.0.0 enhancementairefactoring
tobiu
tobiu commented on Oct 23, 2025, 1:35 PM

In ai/mcp/server/github-workflow/services/SyncService.mjs, the FETCH_RELEASES GraphQL query is called with a hardcoded limit: 100. This is a "magic number" that should be defined in a central configuration file for better maintainability.

// ai/mcp/server/github-workflow/services/SyncService.mjs

const data = await GraphqlService.query(FETCH_RELEASES, {
    owner: aiConfig.owner,
    repo : aiConfig.repo,
    limit: 100, // This should be a config value
    cursor
});

Task

  1. Move this hardcoded value to the issueSync section of the configuration file at @ai/mcp/server/github-workflow/config.mjs.
  2. Create a new property named releaseQueryLimit.
  3. Update SyncService.mjs to import and use this new configuration value.

Discussion on Value

We should also evaluate if 100 is the optimal value.

  • Pro (High Value): A larger number like 100 is efficient for the initial, full synchronization, as it reduces the number of round-trips to the GitHub API.
  • Con (High Value): When there are only 1-2 new releases, fetching 100 is wasteful and consumes more API quota than necessary.

A value of 50 is proposed as a more balanced compromise. It significantly reduces the data fetched during incremental updates while remaining reasonably efficient for the initial full sync.

tobiu assigned to @tobiu on Oct 23, 2025, 1:35 PM
tobiu added the enhancement label on Oct 23, 2025, 1:35 PM
tobiu added the ai label on Oct 23, 2025, 1:35 PM
tobiu added the refactoring label on Oct 23, 2025, 1:35 PM
tobiu referenced in commit 75e947d - "Refactor Magic Number for Release Fetching Pagination #7619" on Oct 23, 2025, 1:38 PM
tobiu closed this issue on Oct 23, 2025, 1:38 PM