Skip to content

Conversation

@Luni-4
Copy link
Collaborator

@Luni-4 Luni-4 commented Dec 22, 2020

Depends on #400

Fixes #367

This PR provide the final script to compute and compare metrics in order to verify whether there are differences among each tree-sitter-language update.

The changes present in this PR are:

  • Split the shell script used to update a tree-sitter-language in order to be more suitable for CI systems
  • Add a command to compute metrics on CI systems that allows to choose where the repository containing source codes is located
  • Use external Rust commands to compare metrics that provide a considerable speed up on large repositories

Thanks in advance for your review! :)

@Luni-4 Luni-4 requested a review from marco-c December 22, 2020 15:21
@Luni-4 Luni-4 force-pushed the final-submodule-script branch from 06aceb4 to 41d3471 Compare December 22, 2020 15:21
@codecov-io
Copy link

codecov-io commented Dec 22, 2020

Codecov Report

Merging #404 (cf3a2e7) into master (f9a4a9c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #404   +/-   ##
=======================================
  Coverage   23.26%   23.26%           
=======================================
  Files          45       45           
  Lines        5489     5489           
  Branches      805      805           
=======================================
  Hits         1277     1277           
  Misses       3690     3690           
  Partials      522      522           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9a4a9c...cf3a2e7. Read the comment docs.

@Luni-4 Luni-4 force-pushed the final-submodule-script branch 2 times, most recently from 45d141a to fcbbeec Compare December 23, 2020 16:05
@Luni-4 Luni-4 requested a review from marco-c December 23, 2020 16:06
Since a CI system uses the commit present in a repository that already
contain the differences, it is not necessary to update the
tree-sitter-language
The two software now used to compare metrics are written in Rust and
provide a considerable speed up on large repositories.
@Luni-4 Luni-4 force-pushed the final-submodule-script branch from fcbbeec to cf3a2e7 Compare December 23, 2020 16:19
Comment on lines +265 to +274
print(f"Cloning rust-code-analysis master branch into /tmp")
run_subprocess(
"git",
"clone",
"--depth=1",
"--recurse-submodules",
"-j8",
"https://github.com/mozilla/rust-code-analysis",
rca_path,
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a local clone, we can just reuse it by checking out to master instead of recloning.

Copy link
Collaborator Author

@Luni-4 Luni-4 Dec 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some CI systems fetch a single branch and you need to reset commits and make complicated stuff to retrieve master branch's commits. This solution could potentially be used on any CI system. It takes less than a second, so we could maintain it imho

@marco-c marco-c merged commit c50d340 into mozilla:master Dec 23, 2020
@Luni-4 Luni-4 deleted the final-submodule-script branch December 24, 2020 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up tree-sitter-language update script

3 participants