Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore announcements in link checker #2222

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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