Skip to content

Commit

Permalink
Ignore announcements in link checker (#2222)
Browse files Browse the repository at this point in the history
Closes #2100.
  • Loading branch information
Eric-Arellano authored Nov 1, 2024
1 parent ff0bd17 commit 277826f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/guides/latest-updates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,5 @@ Join, participate, contribute! See what events are coming up on the [Qiskit comm
## See all product updates

<Admonition type="tip" title="">
Visit the [Product announcements](https://docs.quantum.ibm.com/announcements/product-updates) to browse all product updates and news.
Visit the [Product announcements](/announcements/product-updates) to browse all product updates and news.
</Admonition>
4 changes: 0 additions & 4 deletions scripts/js/commands/checkInternalLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const SYNTHETIC_FILES: string[] = [
"docs/errors.mdx",
"docs/api/runtime/index.mdx",
"docs/api/runtime/tags/jobs.mdx",
"docs/announcements/product-updates/2024-04-15-backend-run-deprecation.mdx",
"docs/api/qiskit-transpiler-service-rest/index.mdx",
"docs/announcements/product-updates/2024-09-16-code-assistant.mdx",
];

interface Arguments {
Expand Down Expand Up @@ -277,8 +275,6 @@ async function determineHistoricalFileBatches(
}

async function determineQiskitLegacyReleaseNotes(): Promise<FileBatch> {
const result: FileBatch[] = [];

const legacyVersions = (
await globby("docs/api/qiskit/release-notes/[!index]*")
)
Expand Down
2 changes: 2 additions & 0 deletions scripts/js/lib/links/FileBatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { globby } from "globby";
import { InternalLink, File } from "./InternalLink.js";
import {
ALWAYS_IGNORED_URLS,
ALWAYS_IGNORED_URL_PREFIXES,
FILES_TO_IGNORES,
IGNORED_FILES,
} from "./ignores.js";
Expand Down Expand Up @@ -115,6 +116,7 @@ export function addLinksToMap(
links.forEach((link) => {
if (
ALWAYS_IGNORED_URLS.has(link) ||
ALWAYS_IGNORED_URL_PREFIXES.some((prefix) => link.startsWith(prefix)) ||
FILES_TO_IGNORES[filePath]?.includes(link)
) {
return;
Expand Down
8 changes: 8 additions & 0 deletions scripts/js/lib/links/ignores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ export const ALWAYS_IGNORED_URLS = new Set([
...ALWAYS_IGNORED_URLS__SHOULD_FIX,
]);

// -----------------------------------------------------------------------------------
// Always ignored URL prefixes - be careful using this
// -----------------------------------------------------------------------------------

export const ALWAYS_IGNORED_URL_PREFIXES: string[] = [
"/announcements/product-updates",
];

// -----------------------------------------------------------------------------------
// Files to ignores
// -----------------------------------------------------------------------------------
Expand Down

0 comments on commit 277826f

Please sign in to comment.