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
24 changes: 9 additions & 15 deletions docs/internal/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ Emitted when the run record is created.
"properties": {
"workflow_slug": "my-workflow",
"source_directory": "/home/user/src/my-project",
"repo_origin_url": "https://github.com/acme/my-project.git",
"base_branch": "main",
"pre_run_git": {
"display_base_sha": "abc123",
"local_dirty": "clean",
"push_outcome": {
"type": "succeeded",
"remote": "origin",
"branch": "main"
}
"git": {
"origin_url": "https://github.com/acme/my-project",
"branch": "main",
"sha": "abc123",
"dirty": "clean"
},
"fork_source_ref": null,
"in_place": false,
Expand All @@ -80,18 +75,17 @@ Emitted when the run record is created.
| `workflow_source` | string? | Workflow source text |
| `labels` | object | Run labels |
| `source_directory` | string? | Submitter-side source directory |
| `repo_origin_url` | string? | Normalized repository origin URL used by clone-based sandboxes |
| `base_branch` | string? | Submitter-side base branch |
| `workflow_slug` | string? | Workflow slug |
| `provenance` | object | Actor and request provenance |
| `manifest_blob` | string? | Blob id for the submitted manifest |
| `pre_run_git` | object? | Submitter-side pre-run git context and push outcome |
| `git` | object? | Git provenance observed before the run: normalized `origin_url`, `branch`, optional `sha`, and `dirty` status |
| `fork_source_ref` | object? | Source run/checkpoint reference when this run was forked |
| `in_place` | boolean | Whether the run was created with `--in-place` (no git checkpoints) |

Readers remain tolerant of the legacy `workflow_config`, `run_dir`, and
`db_prefix` properties when replaying historical events, but newly emitted
`run.created` events omit them.
`db_prefix` properties, and of a legacy `push_outcome` object nested inside
`git`, when replaying historical events; newly emitted `run.created` events
omit them.

### `run.started`

Expand Down
91 changes: 0 additions & 91 deletions docs/public/api-reference/fabro-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9089,7 +9089,6 @@ components:
- origin_url
- branch
- dirty
- push_outcome
properties:
origin_url:
type: string
Expand All @@ -9105,96 +9104,6 @@ components:
example: abc123def
dirty:
$ref: "#/components/schemas/DirtyStatus"
push_outcome:
$ref: "#/components/schemas/PreRunPushOutcome"

PreRunPushOutcome:
description: Outcome of the CLI's best-effort pre-run push.
oneOf:
- $ref: "#/components/schemas/PreRunPushOutcomeNotAttempted"
- $ref: "#/components/schemas/PreRunPushOutcomeSucceeded"
- $ref: "#/components/schemas/PreRunPushOutcomeFailed"
- $ref: "#/components/schemas/PreRunPushOutcomeSkippedNoRemote"
- $ref: "#/components/schemas/PreRunPushOutcomeSkippedRemoteMismatch"
discriminator:
propertyName: type
mapping:
not_attempted: "#/components/schemas/PreRunPushOutcomeNotAttempted"
succeeded: "#/components/schemas/PreRunPushOutcomeSucceeded"
failed: "#/components/schemas/PreRunPushOutcomeFailed"
skipped_no_remote: "#/components/schemas/PreRunPushOutcomeSkippedNoRemote"
skipped_remote_mismatch: "#/components/schemas/PreRunPushOutcomeSkippedRemoteMismatch"

PreRunPushOutcomeNotAttempted:
type: object
required:
- type
properties:
type:
type: string
enum:
- not_attempted

PreRunPushOutcomeSucceeded:
type: object
required:
- type
- remote
- branch
properties:
type:
type: string
enum:
- succeeded
remote:
type: string
branch:
type: string

PreRunPushOutcomeFailed:
type: object
required:
- type
- remote
- branch
- message
properties:
type:
type: string
enum:
- failed
remote:
type: string
branch:
type: string
message:
type: string

PreRunPushOutcomeSkippedNoRemote:
type: object
required:
- type
properties:
type:
type: string
enum:
- skipped_no_remote

PreRunPushOutcomeSkippedRemoteMismatch:
type: object
required:
- type
- remote
- repo_origin_url
properties:
type:
type: string
enum:
- skipped_remote_mismatch
remote:
type: string
repo_origin_url:
type: string

ManifestGoal:
description: Resolved goal kind and content.
Expand Down
10 changes: 0 additions & 10 deletions lib/apps/fabro-cli/tests/it/cmd/support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,11 +845,6 @@ async fn seed_git_backed_changed_run(context: &TestContext) -> SeededGitRunSetup
"branch": "main",
"sha": base_sha,
"dirty": "clean",
"push_outcome": {
"type": "succeeded",
"remote": "origin",
"branch": "main",
},
})),
)
.await;
Expand Down Expand Up @@ -889,11 +884,6 @@ async fn seed_git_backed_noop_run(context: &TestContext) -> RunSetup {
"branch": "main",
"sha": base_sha,
"dirty": "clean",
"push_outcome": {
"type": "succeeded",
"remote": "origin",
"branch": "main",
},
})),
)
.await;
Expand Down
14 changes: 6 additions & 8 deletions lib/apps/fabro-server/src/automation_materializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use fabro_api::types::RunManifest;
use fabro_automation::{AutomationId, AutomationTarget};
use fabro_config::{EnvironmentLayer, MergeMap};
use fabro_manifest::ManifestBuildInput;
use fabro_types::{DirtyStatus, GitContext, GitHubRepositorySlug, PreRunPushOutcome, RunId};
use fabro_types::{DirtyStatus, GitContext, GitHubRepositorySlug, RunId};
use fabro_util::error::collect_chain;
use tokio::{fs, task};

Expand Down Expand Up @@ -199,11 +199,10 @@ fn build_manifest_from_checkout(

let mut manifest = built.manifest;
manifest.git = Some(GitContext {
origin_url: github_metadata_url(&git_context.repo),
branch: git_context.ref_selector,
sha: Some(git_context.checked_out_sha),
dirty: DirtyStatus::Clean,
push_outcome: PreRunPushOutcome::NotAttempted,
origin_url: github_metadata_url(&git_context.repo),
branch: git_context.ref_selector,
sha: Some(git_context.checked_out_sha),
dirty: DirtyStatus::Clean,
});
let submitted_manifest_bytes = serde_json::to_vec(&manifest)
.context("failed to serialize materialized run manifest")
Expand Down Expand Up @@ -299,7 +298,7 @@ mod tests {
use std::collections::HashMap;
use std::fs;

use fabro_types::{DirtyStatus, PreRunPushOutcome};
use fabro_types::DirtyStatus;
use tempfile::TempDir;

use super::*;
Expand Down Expand Up @@ -367,7 +366,6 @@ mod tests {
assert_eq!(git.branch, "release");
assert_eq!(git.sha.as_deref(), Some(sha.as_str()));
assert_eq!(git.dirty, DirtyStatus::Clean);
assert_eq!(git.push_outcome, PreRunPushOutcome::NotAttempted);
let submitted_manifest: serde_json::Value =
serde_json::from_slice(&materialized.submitted_manifest_bytes)
.expect("submitted bytes should be a manifest");
Expand Down
9 changes: 4 additions & 5 deletions lib/apps/fabro-server/src/run_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1695,11 +1695,10 @@ digraph Demo {{

fn git_context(origin_url: &str, branch: &str) -> types::GitContext {
types::GitContext {
origin_url: origin_url.to_string(),
branch: branch.to_string(),
sha: None,
dirty: fabro_types::DirtyStatus::Clean,
push_outcome: fabro_types::PreRunPushOutcome::NotAttempted,
origin_url: origin_url.to_string(),
branch: branch.to_string(),
sha: None,
dirty: fabro_types::DirtyStatus::Clean,
}
}

Expand Down
12 changes: 5 additions & 7 deletions lib/apps/fabro-server/src/server/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3784,8 +3784,7 @@ layer = "project"
"origin_url": "https://github.com/acme/payments.git",
"branch": "feature/compiler",
"sha": "0123456789abcdef",
"dirty": "clean",
"push_outcome": { "type": "not_attempted" }
"dirty": "clean"
});
let manifest: RunManifest = serde_json::from_value(manifest_json).unwrap();
let submitted_manifest_bytes = serde_json::to_vec(&manifest).unwrap();
Expand Down Expand Up @@ -7054,11 +7053,10 @@ async fn create_completed_run_ready_for_pull_request(
);
let git = match (repo_origin_url, base_branch) {
(Some(origin), Some(branch)) => Some(fabro_types::GitContext {
origin_url: origin.to_string(),
branch: branch.to_string(),
sha: None,
dirty: fabro_types::DirtyStatus::Clean,
push_outcome: fabro_types::PreRunPushOutcome::NotAttempted,
origin_url: origin.to_string(),
branch: branch.to_string(),
sha: None,
dirty: fabro_types::DirtyStatus::Clean,
}),
_ => None,
};
Expand Down
9 changes: 4 additions & 5 deletions lib/components/fabro-dump/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,10 @@ mod tests {
automation: None,
source_directory: Some("/tmp/project".to_string()),
git: Some(fabro_types::GitContext {
origin_url: "https://github.com/fabro-sh/fabro.git".to_string(),
branch: "main".to_string(),
sha: None,
dirty: fabro_types::DirtyStatus::Clean,
push_outcome: fabro_types::PreRunPushOutcome::NotAttempted,
origin_url: "https://github.com/fabro-sh/fabro.git".to_string(),
branch: "main".to_string(),
sha: None,
dirty: fabro_types::DirtyStatus::Clean,
}),
labels: HashMap::from([("team".to_string(), "platform".to_string())]),
provenance: test_support::test_run_provenance(),
Expand Down
Loading
Loading