Skip to content

Comments

Fix DAK Publications Page 404 error caused by missing workflow IDs#554

Merged
litlfred merged 2 commits intomainfrom
copilot/fix-553
Aug 8, 2025
Merged

Fix DAK Publications Page 404 error caused by missing workflow IDs#554
litlfred merged 2 commits intomainfrom
copilot/fix-553

Conversation

Copy link
Contributor

Copilot AI commented Aug 5, 2025

The DAK Publications Page was throwing 404 errors when trying to fetch workflow runs:

GET https://api.github.com/repos/WorldHealthOrganization/smart-base/actions/workflows//runs?per_page=1&page=1&branch=updatescript 404 (Not Found)

The issue was caused by the getWorkflows() method in githubService.js creating workflow objects without the GitHub API's workflow id property. When Publications.js attempted to call getWorkflowRunsForWorkflow() with an undefined workflow ID, it resulted in a malformed API URL with double slashes (//runs instead of /12345/runs).

Changes Made

Updated githubService.js:

  • Replaced manual YAML file parsing with GitHub's official listRepoWorkflows API
  • Now returns workflow objects with proper id property required for subsequent API calls
  • Maintains backward compatibility with existing workflow object structure

Enhanced Publications.js:

  • Added validation to ensure ghbuildWorkflow.id exists before making API calls
  • Added defensive logging for better debugging of workflow issues
  • Updated both workflow run fetching and workflow restart functionality with ID validation

Before vs After

Before (Broken):

// Missing id property
const workflow = { name: 'Deploy to GitHub Pages', filename: 'pages.yml' };
// API URL: /actions/workflows//runs → 404 error

After (Fixed):

// Includes proper GitHub API id
const workflow = { id: 12345, name: 'Deploy to GitHub Pages', filename: 'pages.yml' };
// API URL: /actions/workflows/12345/runs → success

The Publications page will now properly display workflow build status indicators for DAK repositories without encountering 404 errors.

Fixes #553.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/owner/repo/contents/input%2Ffsh
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/sgex/sgex/node_modules/jest-worker/build/workers/processChild.js (http block)
  • https://api.github.com/repos/owner/repo/contents/input%2Ffsh%2Fprofile.fsh
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/sgex/sgex/node_modules/jest-worker/build/workers/processChild.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copilot AI changed the title [WIP] DAK Publications Page errors Fix DAK Publications Page 404 error caused by missing workflow IDs Aug 5, 2025
Copilot AI requested a review from litlfred August 5, 2025 13:23
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2025

🔍 Page Framework Compliance Check Results

sgex-workbench@1.0.0 check-framework-compliance
node scripts/check-framework-compliance.js

🔍 SGEX Page Framework Compliance Checker

Found 25 routed page components

✅ WelcomePage: 5/5 (100%) - COMPLIANT

✅ SelectProfilePage: 5/5 (100%) - COMPLIANT

✅ DAKActionSelection: 5/5 (100%) - COMPLIANT

✅ DAKSelection: 5/5 (100%) - COMPLIANT

✅ OrganizationSelection: 5/5 (100%) - COMPLIANT

✅ DAKConfiguration: 5/5 (100%) - COMPLIANT

✅ DashboardRedirect: 5/5 (100%) - COMPLIANT

✅ DAKDashboardWithFramework: 5/5 (100%) - COMPLIANT

✅ TestDashboard: 5/5 (100%) - COMPLIANT

✅ TestingViewer: 5/5 (100%) - COMPLIANT

✅ CoreDataDictionaryViewer: 5/5 (100%) - COMPLIANT

✅ ComponentEditor: 5/5 (100%) - COMPLIANT

✅ ActorEditor: 5/5 (100%) - COMPLIANT

✅ BusinessProcessSelection: 5/5 (100%) - COMPLIANT

⚠️ BPMNEditor: 3/5 (60%) - PARTIAL
Issues: Missing PageLayout wrapper
Suggestions: Wrap component with PageLayout from ./framework

✅ BPMNViewer: 5/5 (100%) - COMPLIANT

✅ BPMNViewerTestComponent: 5/5 (100%) - COMPLIANT

✅ BPMNSource: 5/5 (100%) - COMPLIANT

✅ DecisionSupportLogicView: 5/5 (100%) - COMPLIANT

✅ DocumentationViewer: 5/5 (100%) - COMPLIANT

✅ PagesManager: 5/5 (100%) - COMPLIANT

✅ LandingPageWithFramework: 5/5 (100%) - COMPLIANT

✅ TestDocumentationPage: 5/5 (100%) - COMPLIANT

⚠️ AssetEditorTest: 3/5 (60%) - PARTIAL
Issues: Missing PageLayout wrapper
Suggestions: Wrap component with PageLayout from ./framework

✅ NotFound: 5/5 (100%) - COMPLIANT

📊 COMPLIANCE SUMMARY

✅ Fully Compliant: 23/25
⚠️ Partially Compliant: 2/25
❌ Non-Compliant: 0/25

📈 Overall Compliance: 92%

⚠️ IMPROVEMENTS NEEDED:
BPMNEditor: Missing PageLayout wrapper
AssetEditorTest: Missing PageLayout wrapper

✅ COMPLIANCE CHECK PASSED
Consider addressing partial compliance issues.


Next Steps

⚠️ Recommended: Consider addressing partial compliance issues.

For migration guidance, see Page Framework Documentation.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2025

🚀 Branch Preview Ready!

Branch: copilot/fix-553
Commit: c59f964
Deployed: 2025-08-08 00:38:01 UTC

🌐 Preview URLs


The branch preview is automatically updated with each push to this branch.

Note: Landing page deployment is handled separately via manual workflow.

@litlfred litlfred marked this pull request as ready for review August 8, 2025 11:41
@litlfred litlfred merged commit 90bcc92 into main Aug 8, 2025
3 checks passed
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.

DAK Publications Page errors

2 participants