Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anshgoyalevil committed Jan 14, 2025
1 parent c101b66 commit b035fc4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-edit-links.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Weekly Link Checker
name: Weekly Docs Link Checker

on:
schedule:
Expand All @@ -17,7 +17,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm install
Expand All @@ -40,7 +40,7 @@ jobs:
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.WEBSITE_SLACK_WEBHOOK }}
SLACK_TITLE: 'Edit Links Checker Errors Report'
SLACK_TITLE: 'Docs Edit Link Checker Errors Report'
SLACK_MESSAGE: |
🚨 The following URLs returned 404 during the link check:
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"generate:tools": "node scripts/build-tools.js",
"test:netlify": "deno test --allow-env --trace-ops netlify/**/*.test.ts",
"test:md": "node scripts/markdown/check-markdown.js",
"test:editlinks": "node scripts/markdown/check-editlinks.js",
"test:editlinks": "node scripts/markdown/check-edit-links.js",
"dev:storybook": "storybook dev -p 6006",
"build:storybook": "storybook build"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/dashboard/build-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ if (require.main === module) {
start(resolve(__dirname, '..', '..', 'dashboard.json'));
}

module.exports = { getLabel, monthsSince, mapGoodFirstIssues, getHotDiscussions, getDiscussionByID, getDiscussions, writeToFile, start, processHotDiscussions };
module.exports = { getLabel, monthsSince, mapGoodFirstIssues, getHotDiscussions, getDiscussionByID, getDiscussions, writeToFile, start, processHotDiscussions, pause };
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,14 @@ const fs = require('fs').promises;
const path = require('path');
const fetch = require('node-fetch-2');
const editUrls = require('../../config/edit-page-config.json');
const { pause } = require('../dashboard/build-dashboard');

const ignoreFiles = [
'reference/specification/v2.x.md',
'reference/specification/v3.0.0-explorer.md',
'reference/specification/v3.0.0.md'
];

/**
* Introduces a delay in the execution flow
* @param {number} ms - The number of milliseconds to pause
*/
async function pause(ms) {
return new Promise((res) => {
setTimeout(res, ms);
});
}

/**
* Process a batch of URLs to check for 404s
* @param {object[]} batch - Array of path objects to check
Expand Down
22 changes: 0 additions & 22 deletions tests/fixtures/markdown/edit-page-config.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const path = require('path');
const fetch = require('node-fetch-2');
const editOptions = require('../fixtures/markdown/edit-page-config.json');
const editOptions = require('../../config/edit-page-config.json');
const {
generatePaths,
processBatch,
checkUrls,
determineEditLink,
main
} = require('../../scripts/markdown/check-editlinks');
} = require('../../scripts/markdown/check-edit-links');
const { determineEditLinkData, processBatchData, testPaths } = require('../fixtures/markdown/check-editlinks-data');

jest.mock('node-fetch-2', () => jest.fn());
Expand Down

0 comments on commit b035fc4

Please sign in to comment.