Compare commits

...

5 Commits

Author SHA1 Message Date
Serhii 19b1a71909
Merge 9e2595503f into f99e192e74 2025-12-05 20:42:45 +02:00
Murat K Ozcan f99e192e74
fix: tea ci nvmrc (#1036) 2025-12-05 12:30:20 -06:00
Brian 9e2595503f
Merge branch 'main' into refactor/use-path-basename-consistently 2025-11-19 20:53:58 -06:00
Serhii 28ecbfe9b5
Merge branch 'main' into refactor/use-path-basename-consistently 2025-11-06 21:30:36 +02:00
Serhii 033aa717f4
refactor: use path.basename() consistently for file extensions
Replace .replace('.agent.yaml', '') with path.basename(file, '.agent.yaml')
for consistency and correct handling of edge cases.

Changes:
- buildAllAgents(): line 238
- checkBuildStatus(): line 333
- listAvailableAgents(): line 452

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 06:21:16 +02:00
4 changed files with 66 additions and 12 deletions

View File

@ -27,10 +27,21 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Determine Node version
id: node-version
run: |
if [ -f .nvmrc ]; then
echo "value=$(cat .nvmrc)" >> "$GITHUB_OUTPUT"
echo "Using Node from .nvmrc"
else
echo "value=24" >> "$GITHUB_OUTPUT"
echo "Using default Node 24 (current LTS)"
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version: ${{ steps.node-version.outputs.value }}
cache: "npm"
- name: Install dependencies
@ -54,10 +65,21 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Determine Node version
id: node-version
run: |
if [ -f .nvmrc ]; then
echo "value=$(cat .nvmrc)" >> "$GITHUB_OUTPUT"
echo "Using Node from .nvmrc"
else
echo "value=22" >> "$GITHUB_OUTPUT"
echo "Using default Node 22 (current LTS)"
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version: ${{ steps.node-version.outputs.value }}
cache: "npm"
- name: Cache Playwright browsers
@ -99,10 +121,21 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Determine Node version
id: node-version
run: |
if [ -f .nvmrc ]; then
echo "value=$(cat .nvmrc)" >> "$GITHUB_OUTPUT"
echo "Using Node from .nvmrc"
else
echo "value=22" >> "$GITHUB_OUTPUT"
echo "Using default Node 22 (current LTS)"
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version: ${{ steps.node-version.outputs.value }}
cache: "npm"
- name: Cache Playwright browsers

View File

@ -15,6 +15,8 @@ variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
# Playwright browser cache
PLAYWRIGHT_BROWSERS_PATH: "$CI_PROJECT_DIR/.cache/ms-playwright"
# Default Node version when .nvmrc is missing
DEFAULT_NODE_VERSION: "24"
# Caching configuration
cache:
@ -29,19 +31,32 @@ cache:
# Lint stage - Code quality checks
lint:
stage: lint
image: node:20
script:
image: node:$DEFAULT_NODE_VERSION
before_script:
- |
NODE_VERSION=$(cat .nvmrc 2>/dev/null || echo "$DEFAULT_NODE_VERSION")
echo "Using Node $NODE_VERSION"
npm install -g n
n "$NODE_VERSION"
node -v
- npm ci
script:
- npm run lint
timeout: 5 minutes
# Test stage - Parallel execution with sharding
.test-template: &test-template
stage: test
image: node:20
image: node:$DEFAULT_NODE_VERSION
needs:
- lint
before_script:
- |
NODE_VERSION=$(cat .nvmrc 2>/dev/null || echo "$DEFAULT_NODE_VERSION")
echo "Using Node $NODE_VERSION"
npm install -g n
n "$NODE_VERSION"
node -v
- npm ci
- npx playwright install --with-deps chromium
artifacts:
@ -75,7 +90,7 @@ test:shard-4:
# Burn-in stage - Flaky test detection
burn-in:
stage: burn-in
image: node:20
image: node:$DEFAULT_NODE_VERSION
needs:
- test:shard-1
- test:shard-2
@ -86,6 +101,12 @@ burn-in:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
before_script:
- |
NODE_VERSION=$(cat .nvmrc 2>/dev/null || echo "$DEFAULT_NODE_VERSION")
echo "Using Node $NODE_VERSION"
npm install -g n
n "$NODE_VERSION"
node -v
- npm ci
- npx playwright install --with-deps chromium
script:

View File

@ -61,8 +61,8 @@ Scaffolds a production-ready CI/CD quality pipeline with test execution, burn-in
- Ask user if unable to auto-detect
5. **Read Environment Configuration**
- Check for `.nvmrc` to determine Node version
- Default to Node 20 LTS if not found
- Use `.nvmrc` for Node version if present
- If missing, default to a current LTS (Node 24) or newer instead of a fixed old version
- Read `package.json` to identify dependencies (affects caching strategy)
**Halt Condition:** If preflight checks fail, stop immediately and report which requirement failed.

View File

@ -235,7 +235,7 @@ async function buildAllAgents(projectDir, force = false) {
continue;
}
const agentName = file.replace('.agent.yaml', '');
const agentName = path.basename(file, '.agent.yaml');
const agentYamlPath = path.join(agentsDir, file);
const outputPath = path.join(agentsDir, `${agentName}.md`);
@ -330,7 +330,7 @@ async function checkBuildStatus(projectDir) {
continue;
}
const agentName = file.replace('.agent.yaml', '');
const agentName = path.basename(file, '.agent.yaml');
const agentYamlPath = path.join(agentsDir, file);
const outputPath = path.join(agentsDir, `${agentName}.md`);
@ -449,7 +449,7 @@ async function listAvailableAgents(projectDir) {
for (const file of files) {
if (file.endsWith('.agent.yaml')) {
const agentName = file.replace('.agent.yaml', '');
const agentName = path.basename(file, '.agent.yaml');
console.log(chalk.dim(` - ${agentName} (${module})`));
}
}