📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -337,6 +337,11 @@ const CATEGORY_RULES = [
|
||||
},
|
||||
];
|
||||
|
||||
const FRONTMATTER_CATEGORY_OVERRIDES = new Map([
|
||||
["business", "business"],
|
||||
["product", "business"],
|
||||
]);
|
||||
|
||||
const BUNDLE_RULES = {
|
||||
"core-dev": {
|
||||
description:
|
||||
@@ -559,6 +564,12 @@ function deriveTags(skill) {
|
||||
}
|
||||
|
||||
function detectCategory(skill, tags) {
|
||||
const explicitCategory =
|
||||
typeof skill.category === "string" ? skill.category.trim().toLowerCase() : "";
|
||||
if (FRONTMATTER_CATEGORY_OVERRIDES.has(explicitCategory)) {
|
||||
return FRONTMATTER_CATEGORY_OVERRIDES.get(explicitCategory);
|
||||
}
|
||||
|
||||
const haystack = normalizeTokens([
|
||||
...tags,
|
||||
...tokenize(skill.name),
|
||||
|
||||
@@ -1,9 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const https = require('node:https');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const DEFAULT_BASE_URL = 'https://sickn33.github.io/antigravity-awesome-skills';
|
||||
const baseUrl = (process.env.SEO_LIVE_BASE_URL || DEFAULT_BASE_URL).replace(/\/+$/, '');
|
||||
const repoRoot = path.resolve(__dirname, '..', '..');
|
||||
|
||||
function readExpectedState() {
|
||||
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, 'package.json'), 'utf8'));
|
||||
const skills = JSON.parse(fs.readFileSync(path.join(repoRoot, 'skills_index.json'), 'utf8'));
|
||||
if (!Array.isArray(skills)) {
|
||||
throw new Error('skills_index.json must contain an array');
|
||||
}
|
||||
return {
|
||||
countLabel: `${skills.length.toLocaleString('en-US')}+`,
|
||||
releaseLabel: `V${pkg.version}`,
|
||||
};
|
||||
}
|
||||
|
||||
function fetchText(url, redirectsRemaining = 5) {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -54,6 +69,7 @@ function assertNotIncludes(text, snippet, label) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const expected = readExpectedState();
|
||||
const [home, plugins, sitemap, llms, robots] = await Promise.all([
|
||||
fetchText(`${baseUrl}/`),
|
||||
fetchText(`${baseUrl}/plugins`),
|
||||
@@ -62,10 +78,11 @@ async function main() {
|
||||
fetchText(`${baseUrl}/robots.txt`),
|
||||
]);
|
||||
|
||||
assertIncludes(home, 'Antigravity Awesome Skills | 1,508+ AI coding skills and plugins', 'home');
|
||||
assertIncludes(home, `Antigravity Awesome Skills GitHub | ${expected.countLabel} AI coding skills`, 'home');
|
||||
assertIncludes(home, 'SoftwareSourceCode', 'home JSON-LD');
|
||||
assertIncludes(home, 'FAQPage', 'home JSON-LD');
|
||||
assertIncludes(home, 'specialized plugins', 'home');
|
||||
assertIncludes(home, expected.countLabel, 'home');
|
||||
assertNotIncludes(home, 'prompt templates', 'home');
|
||||
|
||||
assertIncludes(plugins, 'AAS Specialized Plugins | 15 AI coding workflow packs', 'plugins');
|
||||
@@ -74,6 +91,8 @@ async function main() {
|
||||
|
||||
assertIncludes(sitemap, `${baseUrl}/plugins`, 'sitemap');
|
||||
assertIncludes(llms, `${baseUrl}/plugins`, 'llms.txt');
|
||||
assertIncludes(llms, `Current release: ${expected.releaseLabel}.`, 'llms.txt');
|
||||
assertIncludes(llms, expected.countLabel, 'llms.txt');
|
||||
assertIncludes(robots, 'User-agent: GPTBot', 'robots.txt');
|
||||
assertIncludes(robots, 'User-agent: OAI-SearchBot', 'robots.txt');
|
||||
assertIncludes(robots, 'User-agent: ClaudeBot', 'robots.txt');
|
||||
|
||||
@@ -11,6 +11,16 @@ buildCatalog();
|
||||
|
||||
const bundleData = JSON.parse(fs.readFileSync(bundlesPath, "utf8"));
|
||||
const bundles = bundleData.bundles || {};
|
||||
const catalog = JSON.parse(
|
||||
fs.readFileSync(path.join(repoRoot, "data", "catalog.json"), "utf8"),
|
||||
);
|
||||
const skillsById = new Map(catalog.skills.map((skill) => [skill.id, skill]));
|
||||
|
||||
assert.strictEqual(
|
||||
skillsById.get("before-you-build").category,
|
||||
"business",
|
||||
"explicit product frontmatter should keep product-risk skills out of security",
|
||||
);
|
||||
|
||||
for (const bundleId of [
|
||||
"core-dev",
|
||||
|
||||
+14
-6
@@ -94,36 +94,44 @@ class WeaviateConnectionLoggingSecurityTests(unittest.TestCase):
|
||||
"aws-secret-value",
|
||||
]
|
||||
|
||||
def _capture_stderr(self, callback):
|
||||
def _capture_stderr(self, callback, env=None):
|
||||
stderr = io.StringIO()
|
||||
with patch.dict(os.environ, self.ENV, clear=True):
|
||||
with patch.dict(os.environ, env or self.ENV, clear=True):
|
||||
with contextlib.redirect_stderr(stderr):
|
||||
callback()
|
||||
return stderr.getvalue()
|
||||
|
||||
def test_context_manager_verbose_output_omits_secret_names_and_values(self):
|
||||
def test_context_manager_does_not_forward_provider_keys_by_default(self):
|
||||
for relative_path, module_name in self.MODULE_PATHS:
|
||||
with self.subTest(relative_path=relative_path):
|
||||
module = load_module(relative_path, module_name)
|
||||
headers_seen = []
|
||||
|
||||
def run_client():
|
||||
headers_seen.append(module.get_headers())
|
||||
with module.get_client(verbose=True):
|
||||
pass
|
||||
|
||||
output = self._capture_stderr(run_client)
|
||||
|
||||
self.assertIn("Detected 2 providers.", output)
|
||||
self.assertEqual([None], headers_seen)
|
||||
self.assertNotIn("Detected", output)
|
||||
self.assertIn("Connecting to Weaviate...", output)
|
||||
for forbidden in self.FORBIDDEN_OUTPUT:
|
||||
self.assertNotIn(forbidden, output)
|
||||
|
||||
def test_connect_client_verbose_output_omits_secret_names_and_values(self):
|
||||
def test_allowlisted_provider_verbose_output_omits_secret_names_and_values(self):
|
||||
for relative_path, module_name in self.MODULE_PATHS:
|
||||
with self.subTest(relative_path=relative_path):
|
||||
module = load_module(relative_path, module_name)
|
||||
env = {
|
||||
**self.ENV,
|
||||
"WEAVIATE_PROVIDER_KEYS": "OPENAI_API_KEY,AWS_SECRET_KEY",
|
||||
}
|
||||
|
||||
output = self._capture_stderr(
|
||||
lambda: module.connect_client(verbose=True).close()
|
||||
lambda: module.connect_client(verbose=True).close(),
|
||||
env=env,
|
||||
)
|
||||
|
||||
self.assertIn("Detected 2 providers.", output)
|
||||
|
||||
Reference in New Issue
Block a user