Skip to content
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
31 changes: 31 additions & 0 deletions .github/workflows/integration.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
# generated by zed-pkg-test/test-org-fleet; edit the fleet manifest or bootstrapper, not this file.
name: gated integration

on:
workflow_dispatch:
schedule:
- cron: '17 8 * * *'

permissions:
contents: read

jobs:
integration:
if: ${{ vars.ENABLE_TEST_FLEET_INTEGRATION == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Check out source pins and submodules
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
show-progress: false
submodules: recursive
token: ${{ secrets.TEST_FLEET_READ_TOKEN || github.token }}
- name: Validate contract
run: node scripts/validate-plan.mjs
- name: Explain profile gate
run: |
echo "Profile: sdk-consumer"
echo "Required checks are defined in test-plan.json."
echo "Add product-specific executable fixtures here without weakening the generated contract."
31 changes: 31 additions & 0 deletions .github/workflows/test-harness-contract.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
# generated by zed-pkg-test/test-org-fleet; edit the fleet manifest or bootstrapper, not this file.
name: generated test harness contract

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: generated-contract-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
contract:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out without credentials
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
show-progress: false
submodules: false
- name: Validate generated plan, source pins, and gitlinks
run: node scripts/validate-plan.mjs
- name: Record profile
run: printf '%s\n' "sdk-consumer" > generated-profile.txt
10 changes: 10 additions & 0 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
# generated by zed-pkg-test/test-org-fleet; edit the fleet manifest or bootstrapper, not this file.
.env
.env.*
!.env.example
node_modules/
.dart_tool/
target/
build/
.zed/
.vendor/
5 changes: 5 additions & 0 deletions .gitmodules
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
# generated by zed-pkg-test/test-org-fleet; edit the fleet manifest or bootstrapper, not this file.
[submodule "vendor/zed-interfaces"]
path = vendor/zed-interfaces
url = https://github.com/zed-pkg/zed-interfaces.git

17 changes: 17 additions & 0 deletions .zpkg.toml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
# generated by zed-pkg-test/test-org-fleet; edit the fleet manifest or bootstrapper, not this file.
[package]
org = "zed-pkg-test"
name = "java-lib"
version = "0.1.0"
description = "java adapter projection; Maven packaging; frozen replay"
license = "MIT"

[package.repository]
vcs = "git"
url = "https://github.com/zed-pkg-test/java-lib"

[install]
dir = ".vendor/.zed"

[dependencies]
"zed-pkg/zed-interfaces" = "^0.1.0"
36 changes: 34 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
# java-lib
Generated sdk-consumer test harness for zed-pkg-test.
<!-- generated by zed-pkg-test/test-org-fleet; edit the fleet manifest or bootstrapper, not this file. -->
# zed-pkg-test/java-lib

Generated sdk-consumer harness for zed-pkg.

## Contract

Profile: `sdk-consumer`
Source organization: `zed-pkg`

- java adapter projection
- Maven packaging
- frozen replay

## Immutable source pins

| Source | Commit | Branch observed |
|---|---:|---|
| `zed-pkg/zed-cli` | `7977b1d43231a68e1ac34903e0f18cef5135add6` | `main` |
| `zed-pkg/zed-interfaces` | `5f15f1f2686199924b3e32e7ef8e6a85434bca3e` | `main` |
| `zed-pkg/zed-clients` | `c97ead9ce1cd3675be7704d35e2395fa59f4baa4` | `main` |

## Dependency lanes

| Mode | Source | Manager | Path/subdir |
|---|---|---|---|
| `git-submodule` | `zed-pkg/zed-interfaces` | - | `vendor/zed-interfaces` |
| `zed` | `zed-pkg/zed-interfaces` | - | - |
| `native-package` | `zed-pkg/zed-clients` | `maven` | - |

## Running

The pull-request workflow validates the generated contract without cross-organization credentials. Full integration is intentionally release-gated until required source repositories and organization read credentials are present. Run the profile-specific checks recorded in `test-plan.json` after materializing the submodule, Zed, or native-package lane.

13 changes: 13 additions & 0 deletions package-consumers.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
{
"generatedBy": "generated by zed-pkg-test/test-org-fleet",
"consumers": [
{
"manager": "maven",
"package": null,
"subdir": null,
"source": "zed-pkg/zed-clients",
"sourceSha": "c97ead9ce1cd3675be7704d35e2395fa59f4baa4",
"status": "discover-from-source-artifact"
}
]
}
27 changes: 27 additions & 0 deletions scripts/validate-plan.mjs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
// generated by zed-pkg-test/test-org-fleet; edit the fleet manifest or bootstrapper, not this file.
import fs from 'node:fs';
import childProcess from 'node:child_process';

const plan = JSON.parse(fs.readFileSync(new URL('../test-plan.json', import.meta.url), 'utf8'));
const errors = [];
if (plan.schemaVersion !== 1) errors.push('schemaVersion must be 1');
if (!plan.repository || !plan.profile) errors.push('repository and profile are required');
if (!Array.isArray(plan.focus) || plan.focus.length < 2) errors.push('focus must contain at least two assertions');
if (!Array.isArray(plan.sources) || plan.sources.length === 0) errors.push('at least one source is required');
for (const source of plan.sources ?? []) {
if (source.exists && !/^[0-9a-f]{40}$/.test(source.sha ?? '')) errors.push('existing source must be pinned to a 40-character SHA: ' + source.fullName);
}
for (const dependency of plan.imports ?? []) {
if (!['git-submodule', 'zed', 'native-package'].includes(dependency.mode)) errors.push('unsupported dependency mode: ' + dependency.mode);
}
if (fs.existsSync(new URL('../.gitmodules', import.meta.url))) {
// Nested gitlinks are omitted by a non-recursive tree listing.
const tree = childProcess.execFileSync('git', ['ls-tree', '-r', 'HEAD'], { encoding: 'utf8' });
for (const dependency of plan.imports.filter((item) => item.mode === 'git-submodule')) {
if (!tree.includes('160000 commit') || !tree.includes(dependency.path)) errors.push('missing gitlink for ' + dependency.path);
}
}
const serialized = JSON.stringify(plan);
if (/ghp_[A-Za-z0-9]+|github_pat_[A-Za-z0-9_]+/.test(serialized)) errors.push('credential-shaped value found');
if (errors.length) { for (const error of errors) console.error('error: ' + error); process.exit(1); }
console.log('validated generated test plan for ' + plan.testOrganization + '/' + plan.repository);
20 changes: 20 additions & 0 deletions source-pins.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
{
"generatedBy": "generated by zed-pkg-test/test-org-fleet",
"sources": {
"zed-pkg/zed-cli": {
"branch": "main",
"sha": "7977b1d43231a68e1ac34903e0f18cef5135add6",
"exists": true
},
"zed-pkg/zed-interfaces": {
"branch": "main",
"sha": "5f15f1f2686199924b3e32e7ef8e6a85434bca3e",
"exists": true
},
"zed-pkg/zed-clients": {
"branch": "main",
"sha": "c97ead9ce1cd3675be7704d35e2395fa59f4baa4",
"exists": true
}
}
}
69 changes: 69 additions & 0 deletions test-plan.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
{
"generatedBy": "generated by zed-pkg-test/test-org-fleet",
"schemaVersion": 1,
"sourceOrganization": "zed-pkg",
"testOrganization": "zed-pkg-test",
"repository": "java-lib",
"profile": "sdk-consumer",
"description": "java adapter projection; Maven packaging; frozen replay",
"focus": [
"java adapter projection",
"Maven packaging",
"frozen replay"
],
"services": [],
"matrix": {},
"requiredChecks": [
"dependency-provenance",
"native-package-install",
"zed-install",
"submodule-pin",
"api-smoke"
],
"sources": [
{
"fullName": "zed-pkg/zed-cli",
"exists": true,
"branch": "main",
"sha": "7977b1d43231a68e1ac34903e0f18cef5135add6",
"visibility": "public"
},
{
"fullName": "zed-pkg/zed-interfaces",
"exists": true,
"branch": "main",
"sha": "5f15f1f2686199924b3e32e7ef8e6a85434bca3e",
"visibility": "public"
},
{
"fullName": "zed-pkg/zed-clients",
"exists": true,
"branch": "main",
"sha": "c97ead9ce1cd3675be7704d35e2395fa59f4baa4",
"visibility": "public"
}
],
"sourceGates": [],
"imports": [
{
"source": "zed-pkg/zed-interfaces",
"mode": "git-submodule",
"path": "vendor/zed-interfaces"
},
{
"source": "zed-pkg/zed-interfaces",
"mode": "zed"
},
{
"source": "zed-pkg/zed-clients",
"mode": "native-package",
"manager": "maven"
}
],
"security": {
"immutableSourcePins": true,
"pullRequestCredentials": false,
"leastPrivilege": true,
"redactSecretsAndRawMedia": true
}
}
1 change: 1 addition & 0 deletions vendor/zed-interfaces
Submodule zed-interfaces added at 5f15f1