Skip to content

Make legacy dashboard GitHub settings configurable and dedupe project queries#18

Closed
cywf with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-hardcoded-username-org
Closed

Make legacy dashboard GitHub settings configurable and dedupe project queries#18
cywf with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-hardcoded-username-org

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The legacy dashboard was tied to a specific GitHub user/org and assumed a fixed site repository, which made it non-reusable. In the same area, the Projects snapshot script carried duplicated GraphQL query definitions, and dashboard API failures could take down whole sections instead of degrading cleanly.

  • Dashboard configuration

    • Replaced hardcoded username, organization, and site repo values in dashboard.js with runtime-resolved config.
    • Supports configuration from script data-* attributes or window.GITHUB_DASHBOARD_CONFIG, while preserving current defaults for this repo.
    • Updated the legacy dashboard entrypoints to pass the current repo values explicitly instead of relying on in-file constants.
  • Dashboard failure handling

    • Tightened GitHub API response handling for network errors, invalid JSON, rate limits, 404s, and server-side failures.
    • Changed dashboard loaders to fall back per section (repository health, AI agent metrics, deployment info) instead of failing the entire dashboard initialization path.
    • Removed the hardcoded deployment repo lookup and sourced it from dashboard config.
  • Projects query reuse

    • Extracted the shared Projects v2 selection set into a single query builder used for both repository- and user-scoped fetches.
    • Kept the existing fetch flow intact while removing duplicated GraphQL structure from fetch_projects.ts.
  • Focused coverage

    • Added assertions around the shared query builder so repository/user queries continue to include the expected Projects v2 fields.

Example of the new dashboard configuration surface:

<script
  src="assets/js/dashboard.js"
  data-github-username="cywf"
  data-github-organization="PR-CYBR"
  data-personal-repos="cywf.github.io"
  data-github-site-repo="cywf.github.io"
></script>

Copilot AI changed the title [WIP] Fix hardcoded GitHub username and organization in dashboard.js Make legacy dashboard GitHub settings configurable and dedupe project queries Jul 9, 2026
Copilot finished work on behalf of cywf July 9, 2026 21:33
Copilot AI requested a review from cywf July 9, 2026 21:33
@cywf

cywf commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Closing this draft as stale/superseded during CYWF portfolio cleanup. The current project-first portfolio direction is covered by later overhaul work; please reopen or file a fresh PR if a specific change is still needed.

@cywf cywf closed this Jul 16, 2026
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.

[BUG]: Hardcoded GitHub username and organization in dashboard.js

2 participants