-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CT 1808 diff based partial parsing #6873
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c9064e9
Remove unnecessary deleted_manifest in partial parsing
gshank 521c858
Switch existing file reading to use ReadFilesFromFileSystem
gshank e9d7469
minor cleanup
gshank 97498d6
A bunch of code in ReadFilesFromDiff
gshank d73e500
initial test working
gshank 8f52b31
add another model to test
gshank 88f1982
Changie
gshank 5d028c0
minor updates
gshank 2846e49
Add some dependencies to test_file_diff.py to test finding project
gshank 439b449
Get information on packages, not working...
gshank 204511f
Merge branch 'before_merge' into ct-1808-diff_based_partial_parsing
gshank 9b008e4
Merge branch 'main' into ct-1808-diff_based_partial_parsing
gshank a5aac4a
Add generated CLI API docs
FishtownBuildBot f7991f2
Merge branch 'main' into ct-1808-diff_based_partial_parsing
gshank 6dd6d7c
Fix merge errors
gshank dd1bd92
Fix checksums in artifacts to match change in strip
gshank d57e862
Remove reference to deleted_manifest
gshank ce1b3ee
Remove unused code exploring local dependency files
gshank c764c9f
Finish removing unused log event
gshank File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Enable diff based partial parsing | ||
time: 2023-02-06T08:47:49.688889-05:00 | ||
custom: | ||
Author: gshank | ||
Issue: "6592" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,6 @@ def __init__(self, saved_manifest: Manifest, new_files: MutableMapping[str, AnyS | |
self.project_parser_files: Dict = {} | ||
self.saved_files = self.saved_manifest.files | ||
self.project_parser_files = {} | ||
self.deleted_manifest = Manifest() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the deleted_manifest because it's not necessary. Originally I thought it might be helpful for diagnosing, but it wasn't. |
||
self.macro_child_map: Dict[str, List[str]] = {} | ||
( | ||
self.env_vars_changed_source_files, | ||
|
@@ -268,7 +267,7 @@ def delete_from_saved(self, file_id): | |
# macros/tests | ||
if saved_source_file.parse_file_type in mssat_files: | ||
self.remove_mssat_file(saved_source_file) | ||
self.deleted_manifest.files[file_id] = self.saved_manifest.files.pop(file_id) | ||
self.saved_manifest.files.pop(file_id) | ||
|
||
# macros | ||
if saved_source_file.parse_file_type in mg_files: | ||
|
@@ -311,7 +310,6 @@ def update_mssat_in_saved(self, new_source_file, old_source_file): | |
|
||
# replace source_file in saved and add to parsing list | ||
file_id = new_source_file.file_id | ||
self.deleted_manifest.files[file_id] = old_source_file | ||
self.saved_files[file_id] = deepcopy(new_source_file) | ||
self.add_to_pp_files(new_source_file) | ||
for unique_id in unique_ids: | ||
|
@@ -321,7 +319,6 @@ def remove_node_in_saved(self, source_file, unique_id): | |
if unique_id in self.saved_manifest.nodes: | ||
# delete node in saved | ||
node = self.saved_manifest.nodes.pop(unique_id) | ||
self.deleted_manifest.nodes[unique_id] = node | ||
elif ( | ||
source_file.file_id in self.disabled_by_file_id | ||
and unique_id in self.saved_manifest.disabled | ||
|
@@ -456,7 +453,7 @@ def delete_macro_file(self, source_file, follow_references=False): | |
file_id = source_file.file_id | ||
# It's not clear when this file_id would not exist in saved_files | ||
if file_id in self.saved_files: | ||
self.deleted_manifest.files[file_id] = self.saved_files.pop(file_id) | ||
self.saved_files.pop(file_id) | ||
|
||
def check_for_special_deleted_macros(self, source_file): | ||
for unique_id in source_file.macros: | ||
|
@@ -487,7 +484,6 @@ def handle_macro_file_links(self, source_file, follow_references=False): | |
continue | ||
|
||
base_macro = self.saved_manifest.macros.pop(unique_id) | ||
self.deleted_manifest.macros[unique_id] = base_macro | ||
|
||
# Recursively check children of this macro | ||
# The macro_child_map might not exist if a macro is removed by | ||
|
@@ -565,16 +561,14 @@ def delete_doc_node(self, source_file): | |
# remove the nodes in the 'docs' dictionary | ||
docs = source_file.docs.copy() | ||
for unique_id in docs: | ||
self.deleted_manifest.docs[unique_id] = self.saved_manifest.docs.pop(unique_id) | ||
self.saved_manifest.docs.pop(unique_id) | ||
source_file.docs.remove(unique_id) | ||
# The unique_id of objects that contain a doc call are stored in the | ||
# doc source_file.nodes | ||
self.schedule_nodes_for_parsing(source_file.nodes) | ||
source_file.nodes = [] | ||
# Remove the file object | ||
self.deleted_manifest.files[source_file.file_id] = self.saved_manifest.files.pop( | ||
source_file.file_id | ||
) | ||
self.saved_manifest.files.pop(source_file.file_id) | ||
|
||
# Schema files ----------------------- | ||
# Changed schema files | ||
|
@@ -608,7 +602,7 @@ def delete_schema_file(self, file_id): | |
saved_yaml_dict = saved_schema_file.dict_from_yaml | ||
new_yaml_dict = {} | ||
self.handle_schema_file_changes(saved_schema_file, saved_yaml_dict, new_yaml_dict) | ||
self.deleted_manifest.files[file_id] = self.saved_manifest.files.pop(file_id) | ||
self.saved_manifest.files.pop(file_id) | ||
|
||
# For each key in a schema file dictionary, process the changed, deleted, and added | ||
# elemnts for the key lists | ||
|
@@ -876,8 +870,7 @@ def remove_tests(self, schema_file, dict_key, name): | |
tests = schema_file.get_tests(dict_key, name) | ||
for test_unique_id in tests: | ||
if test_unique_id in self.saved_manifest.nodes: | ||
node = self.saved_manifest.nodes.pop(test_unique_id) | ||
self.deleted_manifest.nodes[test_unique_id] = node | ||
self.saved_manifest.nodes.pop(test_unique_id) | ||
schema_file.remove_tests(dict_key, name) | ||
|
||
def delete_schema_source(self, schema_file, source_dict): | ||
|
@@ -892,7 +885,6 @@ def delete_schema_source(self, schema_file, source_dict): | |
source = self.saved_manifest.sources[unique_id] | ||
if source.source_name == source_name: | ||
source = self.saved_manifest.sources.pop(unique_id) | ||
self.deleted_manifest.sources[unique_id] = source | ||
schema_file.sources.remove(unique_id) | ||
self.schedule_referencing_nodes_for_parsing(unique_id) | ||
|
||
|
@@ -904,7 +896,6 @@ def delete_schema_macro_patch(self, schema_file, macro): | |
del schema_file.macro_patches[macro["name"]] | ||
if macro_unique_id and macro_unique_id in self.saved_manifest.macros: | ||
macro = self.saved_manifest.macros.pop(macro_unique_id) | ||
self.deleted_manifest.macros[macro_unique_id] = macro | ||
macro_file_id = macro.file_id | ||
if macro_file_id in self.new_files: | ||
self.saved_files[macro_file_id] = deepcopy(self.new_files[macro_file_id]) | ||
|
@@ -919,9 +910,7 @@ def delete_schema_exposure(self, schema_file, exposure_dict): | |
if unique_id in self.saved_manifest.exposures: | ||
exposure = self.saved_manifest.exposures[unique_id] | ||
if exposure.name == exposure_name: | ||
self.deleted_manifest.exposures[unique_id] = self.saved_manifest.exposures.pop( | ||
unique_id | ||
) | ||
self.saved_manifest.exposures.pop(unique_id) | ||
schema_file.exposures.remove(unique_id) | ||
elif unique_id in self.saved_manifest.disabled: | ||
self.delete_disabled(unique_id, schema_file.file_id) | ||
|
@@ -935,9 +924,7 @@ def delete_schema_group(self, schema_file, group_dict): | |
group = self.saved_manifest.groups[unique_id] | ||
if group.name == group_name: | ||
self.schedule_nodes_for_parsing(self.saved_manifest.group_map[group.name]) | ||
self.deleted_manifest.groups[unique_id] = self.saved_manifest.groups.pop( | ||
unique_id | ||
) | ||
self.saved_manifest.groups.pop(unique_id) | ||
schema_file.groups.remove(unique_id) | ||
|
||
# metrics are created only from schema files, but also can be referred to by other nodes | ||
|
@@ -951,9 +938,7 @@ def delete_schema_metric(self, schema_file, metric_dict): | |
# Need to find everything that referenced this metric and schedule for parsing | ||
if unique_id in self.saved_manifest.child_map: | ||
self.schedule_nodes_for_parsing(self.saved_manifest.child_map[unique_id]) | ||
self.deleted_manifest.metrics[unique_id] = self.saved_manifest.metrics.pop( | ||
unique_id | ||
) | ||
self.saved_manifest.metrics.pop(unique_id) | ||
schema_file.metrics.remove(unique_id) | ||
elif unique_id in self.saved_manifest.disabled: | ||
self.delete_disabled(unique_id, schema_file.file_id) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like you removed this event from types.proto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pfft. Good catch. Have removed.