sapling/configerator/structs/scm/mononoke/megarepo/megarepo_configs.thrift
Kostia Balytskyi e60f163a14 megarepo: introduce a cfgr-synced copy of megarepo_configs.thrift
Summary:
This diff adds boilerplate needed to have a cfgr-sourced (D27623488)
`megarepo_configs.thrift` live in `fbcode` successfully. This diff does
introduce any new use-cases for the file.

Note that I suspect that it's better to sync this file to www from fbcode, not from configerator, because the import path for `megarepo_configs.thrfit` in `source_control.thrift` should be the same across `fbcode` and `www`, and files are imported differently into `www` from `fbcode` and `configerator` unfortunately. As another justification, I think keanu's [`traffic_types.thrift`](https://www.internalfb.com/intern/diffusion/WWW/browsefile/master/flib/intern/thrift/if/fbcode/configerator/structs/keanu/glb/traffic_types.thrift) is synced into `www` from `fbcode` also, not from its source of truth in `configerator`.

Reviewed By: StanislavGlebik

Differential Revision: D27647707

fbshipit-source-id: 2bb2fdf1d4a68e686db302783b68062f3d95fb88
2021-04-08 06:41:07 -07:00

82 lines
2.6 KiB
Thrift

// @generated SignedSource<<fe20d8e49e053cc9e42788de286704b6>>
// 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/mononoke/megarepo/megarepo_configs.thrift
// (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
namespace cpp2 facebook.scm.service
namespace py3 scm.service.thrift
namespace py scm.service.thrift.megarepo_configs
namespace php SourceControlMegarepoConfigStructs
// Megarepo service structs
typedef i64 RepoId
typedef string BookmarkName
typedef string Path
typedef string Prefix
typedef string SyncConfigVersion
typedef binary ChangesetId
/// Source revisions we are interested in
union SourceRevision {
/// Source is pinned to a given changeset
1: ChangesetId hash,
/// Source is tracking a bookmark
2: BookmarkName bookmark,
}
/// How to remap paths in a given source
struct SourceMappingRules {
/// If no other rule matches, prepend this prefix
/// to the source path when rewriting
1: Prefix default_prefix,
3: map<Path, Path> linkfiles,
/// Paths for which default behavior is overridden
/// - if a path maps to an empty list, anything
/// starting with it is skipped while rewriting
/// into a target repo
/// - if a path maps to multiple items, many files
/// will be created in the target repo, with the
/// same contents as the original file
4: map<Prefix, list<Prefix>> overrides,
}
/// Synchronization source
struct Source {
/// A name to match sources across version bumps
/// Has no meaning, except for book-keeping
1: string source_name,
/// Monooke repository id, where source is located
2: RepoId repo_id,
/// Name of the original (git) repo, from which this source comes
3: string name,
/// Source revisions, from where sync happens
4: SourceRevision revision,
/// Rules of commit sync
5: SourceMappingRules mapping,
}
/// Synchronization target
struct Target {
/// Mononoke repository id, where the target is located
1: RepoId repo_id,
/// Bookmark, which this target represents
2: BookmarkName bookmark,
}
/// A single version of synchronization config for a target,
/// bundling together all of the corresponding sources
struct SyncTargetConfig {
// A target to which this config can apply
1: Target target,
// All of the sources to sync from
2: list<Source> sources
// The version of this config
3: SyncConfigVersion version
}