Re-sync with internal repository

This commit is contained in:
Facebook Community Bot 2022-01-31 01:24:47 -08:00 committed by Alex Hornby
parent 6d01fa3d6c
commit 8703f53aa0

View File

@ -0,0 +1,93 @@
// @generated SignedSource<<01965ea0e1ef6bd5e49df926eac98611>>
// DO NOT EDIT THIS FILE MANUALLY!
// This file is a mechanical copy of the version in the configerator repo. To
// modify it, edit the copy in the configerator repo instead and copy it over by
// running the following in your fbcode directory:
//
// configerator-thrift-updater scm/hg/hgclientconf/hgclient.thrift
namespace py3 configerator
struct TimeShard {
1: string start,
2: string end,
}
// Represents a boolean condition that evaluates to true or false.
// Condition composition can be done via the not, and, and or values.
// The possible condition values largely conform with the values available in
// Mercurial configparser crate. Case does not matter.
// - https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/eden/scm/lib/configparser/src/dynamicconfig.rs
// - https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/eden/scm/lib/configparser/src/fb/mod.rs
union Condition {
// True if the inner condition is False
1: Condition not_condition (rust.box, cpp.ref_type = "unique"),
// True if all the inner conditions are True
2: list<Condition> and_condition,
// True if any of the inner conditions is True
3: list<Condition> or_condition,
// True if the current repo is one of the listed repos.
// Ex: ["fbsource", "www"]
4: list<string> repos,
// True if the current platform is one of the listed platforms.
// Ex: ["osx", "windows", "centos", "fedora", "ubuntu"]
5: list<string> platforms,
// True if the current domain is one of the listed domains
// Ex: ["corp", "prod"]
6: list<string> domains,
// True if the current host is in one of the listed smc tiers
// Ex: ["sys.devservers"]
7: list<string> tiers,
// True if the current host is one of the listed hosts
// Ex: ["devvm1069.prn3.facebook.com"]
8: list<string> hosts,
// True if the current host is in the given release phase
// Ex: "dev", "alpha", "beta", or "stable"
9: string group,
// True if the current host is in the given shard
// Ex: "1", "5", "45", "90", or "100"
10: i32 shard,
// True if the current user is in the given user shard. User shard is based
// off their Mercurial ui.username value.
// Ex: "1", "5", "45", "90", or "100"
11: i32 user_shard,
// True if the current time is within the given time shard. It contains a
// start and end date, and more clients return True for this as it gets
// closer to the end date. Standard Mercurial date strings are allowed.
// Ex: ("June 9, 2020", "June 21, 2020")
12: TimeShard time_shard,
// True if the current host has one of the listed host prefixes
// Ex: ["devvm"]
13: list<string> host_prefixes,
}
struct Hotfix {
1: string config,
2: Condition condition,
}
// The various configs that should be applied on Mercurial clients. There are
// likely to be three types of configs in the long run: hotfixes, features, and
// raw lua. The order of prededence between them will be such that the most
// flexible configuration can overwrite the least flexible. So the order they
// are applied in will be:
// 1. features
// 2. hotfixes
// 3. lua
struct ClientConfig {
// Hotfixes are ordered and configs are applied in order.
1: list<Hotfix> hotfixes,
// Features will be supported later.
// A feature is single condition that enables or disables a particular
// feature in Mercurial. The actual configs for that feature are in the
// client itself, and the feature flag only controls enabling or disabling
// the feature, and will likely be controlled via automation.
// Roughly equivalent to a Gatekeeper.
// Ex: 2: map<string, Condition> features,
// The features/hotfixes fields facilitate well structured configs and
// easy changes via automation. In the future we may want to supplement or
// replace it with more powerful raw lua configuration abilities.
// Ex: 3: string lua_config,
}