Commit Graph

29 Commits

Author SHA1 Message Date
Catty Steve 0dd4a157ef feat(finalize): add standalone mode with automatic plugin fetching and
hook execution

- Add FinalizeHooks config for early/late stage hook execution
- Support plugin: prefixed commands in hooks to invoke registered
  plugins
- Implement standalone mode that auto-downloads plugins before
  registration
- Add shallow clone and checksum options to plugin config
- Normalize retention format to lowercase in template
- Refactor PathBuf to Path in plugin fetch modules for consistency
2026-04-21 18:13:24 +08:00
Catty Steve d8ba166a3b refactor: centralize ExecutionContext and event handling in main
- Lift ctx creation and event_receiver spawning to main
- Inject ctx and event_tx into prebake/bake/finalize
- Add standalone flag to ExecutionContext
- Wire up finalize command in main
2026-04-21 11:38:02 +08:00
Catty Steve e9128adfa0 feat(baker/finalize): implement plugin system with fetch and mail
support

- Add finalize plugin system with fetch logic for git/https/file sources
- Add plugin checksum verification (SHA256/SHA512, reject MD5/SHA1)
- Add tar archive extraction with gzip/zstd support
- Add git clone and checkout with tag/commit fallback
- Add internal mail plugin with SMTP support and template rendering
- Add shell plugin with YAML-to-envvar argument conversion
- Add retry and timeout configuration for plugins
- Add duration deserialization to milliseconds with human-readable
  formats
- Replace timeout fields with timeout_ms throughout codebase
- Update CustomCommand timeout_ms and hook timeout handling
- Add HBW_ARG_ prefix for shell plugin environment variables
2026-04-21 10:33:21 +08:00
Catty Steve 0c089fd634 feat(baker/finalize): add YAML to shell env var conversion 2026-04-19 09:40:05 +08:00
Catty Steve a1da093176 feat(baker/finalize): Implement plugin manifest support and typed
metadata

- Rename env vars WS_* to HBW_* for consistency
- Add PluginMetadata struct and PluginType enum for typed plugin info
- Support manifest.yml files for external plugin discovery
- Add shell/rhai/dylib plugin stubs with proper type signatures
- Implement shallow argument merge for plugin runtime arguments
2026-04-18 23:58:33 +08:00
Catty Steve a8ed935f6a feat(baker/finalize): Add finalize stage framework with plugin system
and template

Implements the finalize stage infrastructure for HoneyBiscuitWorkshop:
- New finalize module with config, error, event, plugin, stage, and
  template submodules
- Plugin system supporting internal (webhook, mail, satori, in-site) and
  external plugins
- FinalizeConfig schema with version validation for finalize.yml
- Add glob, duration-str, lettre dependencies to workshop-baker
- Expand project documentation (clarification.md, description.md)
- Update .gitignore and fix bake.rs pipeline_functions access

BREAKING CHANGE: Not a buildable version!
2026-04-16 23:33:03 +08:00
Catty Steve 73e1238e20 refactor(bake): redesign parser with state machine and improve builder
- Replace flat parser with state machine (Normal/Decorator/InFunction)
- Change parse_script to accept reference and add proper error handling
- Add Function::find_decorator helper method
- Refactor build_script to accept &Function and support @if/@export
  decorators
- Add condition code generation for @if decorator
- Add export/preexport code for environment variable capture
- Handle trivial scripts by creating Function directly
- Add constants: PIPELINE_SKIP_ERRORCODE and TRIVIAL_SCRIPT_NAME
- Temporarily disable order-based sorting assertion (see TODO)
- Add empty finalize.rs module skeleton
- Update integration tests to expect errors appropriately
2026-04-06 00:07:02 +08:00
Catty Steve 246c2b22f1 feat(bake): Add streaming execution output and Repology endpoint config
- Implement async stdout/stderr streaming with event channel
- Add Repology endpoint configuration in dependencies config
- Refactor PackageManager trait to return Vec<Command>
- Add bootstrap configuration example
- Remove temp/privdrop.rs
2026-04-04 16:59:39 +08:00
Catty Steve 418bdfb2f0 refactor!: remove workshop-pipeline crate and add repology support
BREAKING CHANGE: workshop-pipeline crate removed entirely

- Remove workshop-pipeline/ (config structures, template resolution)
- Add Repology package name resolution to workshop-baker
- Add UPM system dependency collection for cross-pm resolution
- Replace AGENTS.md with concise knowledge base format
- Add crate-specific AGENTS.md files
- Fix various clippy warnings and derive Default where applicable
2026-04-04 13:24:26 +08:00
Catty Steve 2133f8b9b3 feat(bake): implement full bake functionality with template-based script
generation and pipeline scheduling

- Add benchmark infrastructure (Criterion) for parser performance
  testing
- Enhance decorator parsing with new types: Pipe, Parallel, Daemon,
  Health, and Unknown
- Improve parser to track line numbers and handle nested braces
  correctly
- Add implicit `@after` dependencies for pipeline functions in
  topological sort
- Introduce `use_template` flag in builder to support trivial script
  execution
- Update bake function signature to accept Cli parameters and privilege
  detection
- Refactor error handling with structured `ScriptGenerationFailed`
  variant
- Extend integration tests for privilege dropping, engine execution, and
  bake phase
- Comment out daemon and apt modules temporarily for refactoring
2026-04-04 10:12:57 +08:00
Catty Steve b59a702925 feat(bake): add bake module for script execution and refactor error
handling

- Add new bake module with parser, scheduler, decorator, and builder
- Implement topological sorting for functions with @after dependencies
- Add error handling for circular dependencies and unknown dependencies
- Introduce constants module for shared path definitions
- Add BakeError type (renamed from BuilderError) with new variants
- Add PrebakeStage::Never variant for "never drop privileges"
- Simplify decorator parsing and clean up comments
- Remove RustyVault and rust-tongsuo submodules as they are unused
  (temporarily)
- Update .gitignore to include .ruff_cache
2026-04-02 19:34:21 +08:00
Catty Steve b02407a02d chore(baker/prebake): Add comprehensive documentation to prebake module
- Document prebake.rs, bootstrap.rs, and hook.rs with module-level and
  function-level docs
- Rename parse_prebake_config to parse for conciseness
- Change bootstrap() return type from ExecutionResult to ()
- Add dry-run support to bootstrap stage
- Improve test robustness with Docker availability check and unique
  container names
2026-04-01 10:54:51 +08:00
Catty Steve 15aaa6f310 feat(baker/prebake): Add configurable bootstrap stage with dynamic
script generation

The bootstrap stage now reads configuration from prebake.yml to
dynamically generate bootstrap scripts for user creation, workspace
setup, and privilege executor configuration.
Adds the `which` crate for binary detection.
2026-03-31 23:46:11 +08:00
Catty Steve 9174c4dd2a feat: rename to workshop-baker and implement stage-based prebake
workflow

- Rename crate/library/binary from workshop-executor to workshop-baker
- Remove unused modules (decorator, parser, schedule, variable) from lib
- Implement stage-based privilege dropping with prebake_drop_privilege()
- Add dry-run support in executor and CLI
- Add bootstrap.sh template script for user/workspace setup
- Add PrebakeStage::from_str() and Default impl
- Add get_drop_after() function for security config
- Fix version matching to handle "1.0" format variants
- Fix UPM all_managers() to return custom::Custom
- Add Python integration tests with Docker
- Simplify examples/prebake.yml to match template
2026-03-31 20:54:48 +08:00
Catty Steve 20919d53ad refactor(baker/bake): move relating part into separate directory 2026-03-31 13:16:14 +08:00
Catty Steve 3e8b256889 feat(baker/engine): add depsuser stage 2026-03-31 11:53:55 +08:00
Catty Steve 0f6aed6f94 feat(engine): implement UPM/UserPackageManager interface 2026-03-31 11:39:47 +08:00
Catty Steve 960f03269c feat: rename workshop-executor to workshop-baker and add comprehensive
documentation

- Rename crate from workshop-executor to workshop-baker
- Add MDBook documentation infrastructure with Chinese docs (Vol1/2/3)
- Implement engine module with cgroups resource management
- Add package manager support (apt, pacman)
- Add daemon module with Unix socket IPC and heartbeat
- Add privdrop dependency for privilege dropping
- Implement prebake stages (bootstrap, depssystem, depsuser,
  environment, hooks)
- Add new bake.sh.tmpl pipeline template for osu! project
- Add pipeline implicit parameter documentation (PIPELINE_BAREMETAL_*,
  PIPELINE_CONTAINER_*, PIPELINE_UNCOVER_SECRET)
2026-03-30 20:24:54 +08:00
Catty Steve 69056a3a4a feat: add Package Manager 2026-03-11 14:49:10 +08:00
Catty Steve c80500f6ac feat: implement docker env creation for prebake
Also we introduced opencode for code production.
2026-03-10 11:59:58 +08:00
Catty Steve d7ba65fbf4 feat: finish monitor in executor, daemonize executor
Signed-off-by: Catty Steve <4795515+Catty2014@user.noreply.gitee.com>
2026-01-15 11:54:42 +08:00
Catty Steve ab7cbfd730 feat: add engine to ws-executor
Signed-off-by: Catty Steve <4795515+Catty2014@user.noreply.gitee.com>
To be done.
2025-12-28 23:05:02 +08:00
Catty Steve ecf3c66905 feat: add workshop-{executor, helper-mac}
Signed-off-by: Catty Steve <4795515+Catty2014@user.noreply.gitee.com>
2025-12-27 21:46:16 +08:00
Catty Steve f7ea4dfb3e feat: add workshop-pipeline
Signed-off-by: Catty Steve <4795515+Catty2014@user.noreply.gitee.com>
Workshop-pipeline is a crate for parsing prebake/bake/finalize config.
Not finished yet, further testing required.
2025-11-14 11:05:05 +08:00
Catty Steve f66a36d0f4 feat: add workshop-agent and workshop-cert
Signed-off-by: Catty Steve <4795515+Catty2014@user.noreply.gitee.com>
2025-11-13 23:49:16 +08:00
Catty Steve 49aa1dc36c feat: add workshop-vault
Signed-off-by: Catty Steve <4795515+Catty2014@user.noreply.gitee.com>
2025-11-09 22:55:18 +08:00
Catty Steve 004df79e66 feat: add workshop-llm-detector
Signed-off-by: Catty Steve <4795515+Catty2014@user.noreply.gitee.com>
2025-11-09 17:27:18 +08:00
Catty2014 344dc10b98 chore: add LICENSE.
Signed-off-by: Catty2014 <4795515+Catty2014@user.noreply.gitee.com>
2025-11-07 13:47:04 +00:00
Catty Steve f802df1af6 initial commit: add workshop-deviceid crate 2025-11-07 21:34:30 +08:00