File tree Expand file tree Collapse file tree
configerator/structs/scm/mononoke/repos Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // @generated SignedSource<<1b70216f1eec2c5ee90d2654ff35fec7 >>
1+ // @generated SignedSource<<38ae52f7c1accd1259654be6a4722844 >>
22// DO NOT EDIT THIS FILE MANUALLY!
33// This file is a mechanical copy of the version in the configerator repo. To
44// modify it, edit the copy in the configerator repo instead and copy it over by
1313 */
1414
1515include " thrift/annotation/rust.thrift"
16+ include " thrift/annotation/thrift.thrift"
17+
18+ @thrift.AllowLegacyMissingUris
19+ package;
1620
1721namespace py configerator.mononoke.repos
1822namespace py3 mononoke.repos
@@ -554,6 +558,11 @@ struct RawDerivedDataConfig {
554558 9: optional string derivation_queue_scuba_table ;
555559 10: optional RawRemoteDerivationConfig remote_derivation_config ;
556560 11: optional RawDerivedDataBlockedDerivation blocked_derivation ;
561+ // There are cases where a type is selectively backfilled for a certain repo
562+ // but not enabled for general derivation for new incoming commits,
563+ // e.g. inferred_copy_from in fbsource (https://fburl.com/workplace/pic8groe)
564+ // This option is meant to capture that.
565+ 12: optional set<string> extra_types_available_for_read ;
557566}
558567
559568@rust.Exhaustive
Original file line number Diff line number Diff line change @@ -1355,6 +1355,7 @@ mod test {
13551355 blocked_derivation : hashmap ! {
13561356 THREES_CSID => Some ( hashset! { DerivableType :: Unodes , } ) ,
13571357 } ,
1358+ extra_types_available_for_read : hashset ! { } ,
13581359 } ,
13591360 enforce_lfs_acl_check : false ,
13601361 repo_client_use_warm_bookmarks_cache : true ,
Original file line number Diff line number Diff line change @@ -643,6 +643,12 @@ impl Convert for RawDerivedDataConfig {
643643 . map ( |blocked_derivation| blocked_derivation. convert ( ) )
644644 . transpose ( ) ?
645645 . unwrap_or_default ( ) ,
646+ extra_types_available_for_read : self
647+ . extra_types_available_for_read
648+ . unwrap_or_default ( )
649+ . into_iter ( )
650+ . map ( |s| DerivableType :: from_name ( & s) )
651+ . collect :: < Result < _ , _ > > ( ) ?,
646652 } )
647653 }
648654}
Original file line number Diff line number Diff line change @@ -386,6 +386,9 @@ pub struct DerivedDataConfig {
386386
387387 /// Commits with blocked derivation
388388 pub blocked_derivation : HashMap < ChangesetId , Option < HashSet < DerivableType > > > ,
389+
390+ /// Extra derived data types that are available for read but not necessarily enabled for derivation.
391+ pub extra_types_available_for_read : HashSet < DerivableType > ,
389392}
390393
391394impl DerivedDataConfig {
@@ -436,6 +439,14 @@ impl DerivedDataConfig {
436439 . is_none_or ( |types| types. contains ( & derivable_type) )
437440 } )
438441 }
442+
443+ /// Returns whether the named derived data type is readable.
444+ /// A type is readable if it's either in the active config's types or in extra_types_available_for_read.
445+ pub fn is_readable ( & self , derivable_type : DerivableType ) -> bool {
446+ self . extra_types_available_for_read
447+ . contains ( & derivable_type)
448+ || self . is_enabled ( derivable_type)
449+ }
439450}
440451
441452/// Config for derived data types
You can’t perform that action at this time.
0 commit comments