Files
moloapp/example/fw/Workflow.hpp
T

58 lines
1.5 KiB
C++
Raw Normal View History

#pragma once
// Autonomous release pipeline: commits since tag to bump decision, changelog
// writing, and pre-tag verification. Dry-run mode never writes.
// Final home is tools/release/ under namespace molo::workflow; this example
// copy proves the rules and is marked as a demo, not the pipeline itself.
// Gap: real molo::workflow in tools/release/ plus CLI surface in 09-cli-ops.md.
#include <string>
#include <vector>
namespace molo::example::fw {
struct CommitInfo {
std::string type;
std::string scope;
std::string description;
bool breaking = false;
};
bool parse_commit(const std::string& subject, const std::string& body,
CommitInfo& out, std::string& error);
enum class Bump { None, Patch, Minor, Major };
std::string bump_name(Bump bump);
class ReleasePlanner {
public:
Bump decide(const std::vector<CommitInfo>& commits) const;
std::string next_version(const std::string& current,
const std::vector<CommitInfo>& commits) const;
};
class ChangelogWriter {
public:
std::string entry(const std::string& version, const std::string& date,
const std::vector<CommitInfo>& commits) const;
};
struct VerifyCheck {
std::string name;
bool passed = false;
std::string detail;
};
class ReleaseVerifier {
public:
void add_check(std::string name, bool passed, std::string detail = "");
bool green() const;
std::vector<VerifyCheck> checks() const;
private:
std::vector<VerifyCheck> checks_;
};
} // namespace molo::example::fw