Skip to content

Commit

Permalink
Revert D54017026: Multisect successfully blamed "D54017026: Combine A…
Browse files Browse the repository at this point in the history
…st and Schema structs" for one test failure

Summary:
This diff reverts D54017026
D54017026: Combine Ast and Schema structs by iahs causes the following test failure:

Tests affected:
- [cogwheel:cogwheel_windtunnel_e2e_run_slcm#main](https://www.internalfb.com/intern/test/562950069774915/)

Here's the Multisect link:
https://www.internalfb.com/multisect/4389250
Here are the tasks that are relevant to this breakage:

The backout may land if someone accepts it.

If this diff has been generated in error, you can Commandeer and Abandon it.

Differential Revision: D54112811

fbshipit-source-id: 6e391902aea15bad8fe323d593eead8158b58aa9
  • Loading branch information
generatedunixname89002005232357 authored and facebook-github-bot committed Feb 23, 2024
1 parent 51b81f1 commit ec78cc9
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 67 deletions.
79 changes: 74 additions & 5 deletions third-party/thrift/src/thrift/lib/thrift/ast.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,81 @@
*/

include "thrift/lib/thrift/schema.thrift"
include "thrift/lib/thrift/standard.thrift"
include "thrift/lib/thrift/protocol.thrift"
include "thrift/lib/thrift/id.thrift"

namespace py3 apache.thrift
namespace rust thrift_ast

/** This file has been merged into schema.thrift. Please include it and use its types directly. */
typedef schema.SourceInfo SourceInfo
typedef schema.IdentifierRef IdentifierRef
typedef schema.IncludeRef IncludeRef
typedef schema.Schema Ast
/**
* Information about a thrift source file.
*/
struct SourceInfo {
// A source file name. It can include directory components and/or be a
// virtual file name that doesn't have a correspondent entry in the system's
// directory structure.
// Preserves the legacy behavior of sometimes leaking resolved relative paths.
// The unmodified path is available inside schema.Program.
1: string fileName;

/**
* Per-language include statements.
*/
2: map<string, list<id.ValueId>> languageIncludes;

/**
* Per-language namespace.
*/
3: map<string, id.ValueId> namespaces;
}

// An instance of an identifier in a source file.
struct IdentifierRef {
1: schema.SourceRange range;
2: standard.TypeUri uri;
// Because enum values don't have URIs, references to them have to point to their owning enum.
// When that happens this field identifies the particular value being referenced.
3: string enumValue;
}

// An instance of an include in a source file.
struct IncludeRef {
1: schema.SourceRange range;
2: id.ProgramId target;
}

// A thrift schema that corresponds to one or more thrift files.
@cpp.UseOpEncode
struct Ast {
/**
* The programs included in the schema, accessible by `ProgramId`.
* The first program in the program list must be the main file,
* with (recursively) included programs listed after it.
*/
1: schema.ProgramList programs;

/** The values, accessible by `ValueId`. */
2: list<protocol.Value> values;

/** The definitions, accessible by `DefinitionId`. */
4: schema.DefinitionList definitions;

/**
* DEPRECATED! Get the information from the Program struct.
* Information about the files holding the thrift definitions.
*/
5: map<id.ProgramId, SourceInfo> sources;

/**
* The source ranges of all references to named entities in the main program.
* The `source_ranges` option must be passed to thrift2ast to populate this map.
*/
6: list<IdentifierRef> identifierSourceRanges;

/**
* The source ranges of paths included in the main program.
* The `source_ranges` option must be passed to thrift2ast to populate this map.
*/
7: list<IncludeRef> includeSourceRanges;
}
65 changes: 3 additions & 62 deletions third-party/thrift/src/thrift/lib/thrift/schema.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -698,71 +698,12 @@ typedef list<Program> ProgramList
@thrift.Experimental // TODO(afuller): Adapt!
@cpp.UseOpEncode
struct Schema {
/**
* The programs included in the schema, accessible by `ProgramId`.
* The first program in the program list must be the main file,
* with (recursively) included programs listed after it.
*/
/** The programs included in the schema, accessible by `ProgramId`. */
1: ProgramList programs;

/** The values, accessible by `ValueId`. */
2: list<protocol.Value> values;
3: list<protocol.Value> values;

/** The definitions, accessible by `DefinitionId`. */
3: DefinitionList definitions;

/**
* DEPRECATED! Get the information from the Program struct.
* Information about the files holding the thrift definitions.
*/
5: map<id.ProgramId, SourceInfo> sources;

/**
* The source ranges of all references to named entities in the main program.
* The `source_ranges` option must be passed to thrift2ast to populate this map.
*/
6: list<IdentifierRef> identifierSourceRanges;

/**
* The source ranges of paths included in the main program.
* The `source_ranges` option must be passed to thrift2ast to populate this map.
*/
7: list<IncludeRef> includeSourceRanges;
}

/**
* Information about a thrift source file.
*/
struct SourceInfo {
// A source file name. It can include directory components and/or be a
// virtual file name that doesn't have a correspondent entry in the system's
// directory structure.
// Preserves the legacy behavior of sometimes leaking resolved relative paths.
// The unmodified path is available inside schema.Program.
1: string fileName;

/**
* Per-language include statements.
*/
2: map<string, list<id.ValueId>> languageIncludes;

/**
* Per-language namespace.
*/
3: map<string, id.ValueId> namespaces;
}

// An instance of an identifier in a source file.
struct IdentifierRef {
1: SourceRange range;
2: standard.TypeUri uri;
// Because enum values don't have URIs, references to them have to point to their owning enum.
// When that happens this field identifies the particular value being referenced.
3: string enumValue;
}

// An instance of an include in a source file.
struct IncludeRef {
1: SourceRange range;
2: id.ProgramId target;
5: DefinitionList definitions;
}

0 comments on commit ec78cc9

Please sign in to comment.