fix(docusaurus): remove PyPI integration to prevent intermittent build failures (#69324)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: ian.alton@airbyte.io <ian.alton@airbyte.io>
This commit is contained in:
committed by
GitHub
parent
791ac57f8e
commit
02822b6364
@@ -1,7 +1,6 @@
|
||||
const { getFromPaths, toAttributes } = require("../helpers/objects");
|
||||
const { isDocsPage, getRegistryEntry } = require("./utils");
|
||||
const {
|
||||
getLatestPythonCDKVersion,
|
||||
parseCDKVersion,
|
||||
} = require("../scripts/connector_registry");
|
||||
const visit = require("unist-util-visit").visit;
|
||||
@@ -19,21 +18,19 @@ const plugin = () => {
|
||||
if (!docsPageInfo.isDocsPage) return;
|
||||
|
||||
const registryEntry = await getRegistryEntry(vfile);
|
||||
|
||||
const latestPythonCdkVersion = await getLatestPythonCDKVersion();
|
||||
|
||||
if (!registryEntry) return;
|
||||
|
||||
const rawCDKVersion = getFromPaths(
|
||||
registryEntry,
|
||||
"packageInfo_[oss|cloud].cdk_version",
|
||||
);
|
||||
|
||||
let firstHeading = true;
|
||||
|
||||
visit(ast, "heading", (node) => {
|
||||
if (firstHeading && node.depth === 1 && node.children.length === 1) {
|
||||
const originalTitle = node.children[0].value;
|
||||
|
||||
const rawCDKVersion = getFromPaths(
|
||||
registryEntry,
|
||||
"packageInfo_[oss|cloud].cdk_version",
|
||||
);
|
||||
const syncSuccessRate = getFromPaths(
|
||||
registryEntry,
|
||||
"generated_[oss|cloud].metrics.[all|cloud|oss].sync_success_rate",
|
||||
@@ -49,7 +46,7 @@ const plugin = () => {
|
||||
|
||||
const { version, isLatest, url } = parseCDKVersion(
|
||||
rawCDKVersion,
|
||||
latestPythonCdkVersion,
|
||||
null,
|
||||
);
|
||||
|
||||
const attrDict = {
|
||||
@@ -62,7 +59,7 @@ const plugin = () => {
|
||||
issue_url: registryEntry.issue_url,
|
||||
originalTitle,
|
||||
cdkVersion: version,
|
||||
isLatestCDKString: boolToBoolString(isLatest),
|
||||
...(isLatest !== undefined && { isLatestCDKString: boolToBoolString(isLatest) }),
|
||||
cdkVersionUrl: url,
|
||||
syncSuccessRate,
|
||||
usageRate,
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
const memoize = require("lodash/memoize");
|
||||
|
||||
const fetchLatestVersionOfPyPackage = memoize(async (packageName) => {
|
||||
const json = await fetch(`https://pypi.org/pypi/${packageName}/json`).then(
|
||||
(resp) => resp.json(),
|
||||
);
|
||||
return json.info.version;
|
||||
});
|
||||
|
||||
const getLatestPythonCDKVersion = async () =>
|
||||
fetchLatestVersionOfPyPackage("airbyte-cdk");
|
||||
|
||||
const parseCDKVersion = (
|
||||
connectorCdkVersion,
|
||||
latestPythonCdkVersion,
|
||||
@@ -22,9 +10,8 @@ const parseCDKVersion = (
|
||||
const [language, version] = connectorCdkVersion.split(":");
|
||||
switch (language) {
|
||||
case "python":
|
||||
const isLatest = version === latestPythonCdkVersion;
|
||||
const packageUrl = `https://pypi.org/project/airbyte-cdk/${version}/`;
|
||||
return { version, isLatest, url: packageUrl };
|
||||
return { version, url: packageUrl };
|
||||
case "java":
|
||||
return { version, isLatest: version === latestJavaCdkVersion, url: null };
|
||||
default:
|
||||
@@ -51,7 +38,6 @@ module.exports = {
|
||||
isPypiConnector: (connector) => {
|
||||
return Boolean(connector.remoteRegistries_oss?.pypi?.enabled);
|
||||
},
|
||||
getLatestPythonCDKVersion,
|
||||
parseCDKVersion,
|
||||
getSupportLevelDisplay,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user