Commit Graph

24 Commits

Author SHA1 Message Date
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