Skip to content

Commit

Permalink
Remove config versioning
Browse files Browse the repository at this point in the history
Summary:
Versioning configs is kind of backwards to the normal way of
doing things. People usually expect the code to be versioned, and configs
to target major release versions of code. Versioning the configs is sort
of like versioned symbols in that both parties (code and config) are
screwed in really tightly to each other.

Differential Revision: D14761961

fbshipit-source-id: f6e87aaec1473345c6f907fed0466079613ea359
  • Loading branch information
danobi authored and facebook-github-bot committed Apr 4, 2019
1 parent 3016f1f commit b799aa6
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 13 deletions.
5 changes: 0 additions & 5 deletions config/ConfigCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ std::unique_ptr<Engine::Engine> compile(const IR::Root& root) {
Engine::MonitoredResources resources;
std::vector<std::unique_ptr<Engine::Ruleset>> rulesets;

if (root.version.empty()) {
OLOG << "No version string specified";
return nullptr;
}

for (const auto& ruleset : root.rulesets) {
auto compiled_ruleset = compileRuleset(resources, ruleset);
if (!compiled_ruleset) {
Expand Down
1 change: 0 additions & 1 deletion config/ConfigCompilerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class CompilerTest : public ::testing::Test {
public:
CompilerTest() {
count = 0;
root.version = "1.0.0";
}

std::unique_ptr<::Oomd::Engine::Engine> compile() {
Expand Down
2 changes: 0 additions & 2 deletions config/ConfigTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ void dumpIR(const Root& root) {
--indent;
}
--indent;

OLOG << getIndentSpaces(indent) << "Version=" << root.version;
}

} // namespace IR
Expand Down
1 change: 0 additions & 1 deletion config/ConfigTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ struct Ruleset {

struct Root {
std::vector<Ruleset> rulesets;
std::string version;
};

void dumpIR(const Root& root);
Expand Down
2 changes: 0 additions & 2 deletions config/JsonConfigParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ std::unique_ptr<IR::Root> JsonConfigParser::parse(const std::string& input) {
ir_root->rulesets.emplace_back(parseRuleset(ruleset));
}

ir_root->version = json_root.get("version", "").asString();

IR::dumpIR(*ir_root);
return ir_root;
}
Expand Down
3 changes: 1 addition & 2 deletions config/JsonConfigParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
using namespace Oomd::Config2;
using namespace testing;

constexpr auto kConfig_1_0_0 = "oomd/fixtures/oomd_1_0_0.json";
constexpr auto kConfig_1_0_0 = "oomd/fixtures/oomd.json";

TEST(JsonConfigParserTest, LoadIR) {
std::ifstream file(kConfig_1_0_0, std::ios::in);
Expand All @@ -41,7 +41,6 @@ TEST(JsonConfigParserTest, LoadIR) {

// Check root values
ASSERT_EQ(root->rulesets.size(), 2);
EXPECT_EQ(root->version, "1.0.0");

// Check first ruleset
const auto& first = root->rulesets[0];
Expand Down
File renamed without changes.

0 comments on commit b799aa6

Please sign in to comment.