Skip to content
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

chore(infra): add error variant for file not found on get path #2169

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

ArniStarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
full_committer_flow performance regressed!
full_committer_flow time: [30.615 ms 30.655 ms 30.698 ms]
change: [+3.6680% +3.9167% +4.1523%] (p = 0.00 < 0.05)
Performance has regressed.
Found 6 outliers among 100 measurements (6.00%)
6 (6.00%) high mild

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.21%. Comparing base (e3165c4) to head (2910d40).
Report is 532 commits behind head on main.

Files with missing lines Patch % Lines
crates/infra_utils/src/path.rs 77.77% 1 Missing and 1 partial ⚠️
.../starknet_sequencer_node/src/config/node_config.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2169       +/-   ##
===========================================
+ Coverage   40.10%   77.21%   +37.10%     
===========================================
  Files          26      386      +360     
  Lines        1895    40412    +38517     
  Branches     1895    40412    +38517     
===========================================
+ Hits          760    31203    +30443     
- Misses       1100     6905     +5805     
- Partials       35     2304     +2269     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/share_get_absolute_path branch from cb4bbcb to f154aa3 Compare November 19, 2024 12:58
@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/error_handle_file_not_found branch from 48c61ac to d9f1236 Compare November 19, 2024 12:59
Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [33.611 ms 33.803 ms 34.093 ms]
change: [-5.1543% -3.5211% -1.9901%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
2 (2.00%) high mild
8 (8.00%) high severe

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 11 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)


crates/infra_utils/src/path.rs line 27 at r1 (raw file):

        // If `CARGO_MANIFEST_DIR` isn't set, fall back to the current working directory
        .unwrap_or(env::current_dir().expect("Failed to get current directory"));
    let path_buf = base_dir.join(relative_path);

Please remove this suffix.

Code quote:

_buf

@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/share_get_absolute_path branch from f154aa3 to 4ec2420 Compare November 19, 2024 15:11
@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/error_handle_file_not_found branch from d9f1236 to a731f1d Compare November 19, 2024 15:11
Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
full_committer_flow performance improved 😺
full_committer_flow time: [29.323 ms 29.359 ms 29.397 ms]
change: [-1.9867% -1.7763% -1.5781%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild

Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 11 files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware)


crates/infra_utils/src/path.rs line 27 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please remove this suffix.

Done.

@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/share_get_absolute_path branch from 4ec2420 to ca5efcc Compare November 20, 2024 05:19
@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/error_handle_file_not_found branch from a731f1d to 07744c9 Compare November 20, 2024 05:20
Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
full_committer_flow performance improved 😺
full_committer_flow time: [29.497 ms 29.549 ms 29.605 ms]
change: [-2.1949% -1.9385% -1.6920%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/share_get_absolute_path branch from ca5efcc to 4686fa7 Compare November 21, 2024 07:20
@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/error_handle_file_not_found branch from 07744c9 to 41012c8 Compare November 21, 2024 07:20
Copy link

Artifacts upload triggered. View details here

@ArniStarkware ArniStarkware changed the base branch from arni/infra_utils/share_get_absolute_path to graphite-base/2169 November 21, 2024 07:53
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 9 files at r2.
Reviewable status: 1 of 11 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)


crates/infra_utils/src/path.rs line 8 at r2 (raw file):

#[derive(Debug, Error)]
pub enum GetPathError {

Maybe PathResolutionError? WDYT?

Code quote:

GetPathError

crates/infra_utils/src/path.rs line 15 at r2 (raw file):

    IoError(#[from] std::io::Error),
}

Please add a todo on me (tsabary): wrap path-related env::* invocations in the repo as utility functions here


crates/infra_utils/src/path.rs line 40 at r2 (raw file):

    Ok(path)
}

Please add tests for this: one that successfully resolves a path, one that returns PathDoesNotExist, and one that results in IoError.

Code quote:

pub fn resolve_project_relative_path(relative_path: &str) -> Result<PathBuf, GetPathError> {
    let base_dir = path_of_project_root();

    let path = base_dir.join(relative_path);
    if !path.try_exists()? {
        return Err(GetPathError::PathDoesNotExist { path });
    }

    Ok(path)
}

Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
full_committer_flow performance improved 😺
full_committer_flow time: [29.363 ms 29.409 ms 29.465 ms]
change: [-1.6816% -1.4738% -1.2849%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe

@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/error_handle_file_not_found branch from 41012c8 to dcd74fc Compare November 21, 2024 08:15
@ArniStarkware ArniStarkware changed the base branch from graphite-base/2169 to main November 21, 2024 08:16
@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/error_handle_file_not_found branch from dcd74fc to 622ea22 Compare November 21, 2024 08:16
Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

@ArniStarkware ArniStarkware force-pushed the arni/infra_utils/error_handle_file_not_found branch from 622ea22 to 2910d40 Compare November 21, 2024 08:27
Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 11 files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware)


crates/infra_utils/src/path.rs line 8 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Maybe PathResolutionError? WDYT?

Done.


crates/infra_utils/src/path.rs line 15 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please add a todo on me (tsabary): wrap path-related env::* invocations in the repo as utility functions here

Done.

Copy link

Benchmark movements:
full_committer_flow performance improved 😺
full_committer_flow time: [29.508 ms 29.566 ms 29.627 ms]
change: [-3.0308% -2.7781% -2.5161%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 11 files at r1, 7 of 9 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)


crates/infra_utils/src/path.rs line 40 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please add tests for this: one that successfully resolves a path, one that returns PathDoesNotExist, and one that results in IoError.

Will be in a different pr.

@ArniStarkware ArniStarkware merged commit e07b3df into main Nov 21, 2024
22 checks passed
@ArniStarkware
Copy link
Contributor Author

crates/infra_utils/src/path.rs line 40 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Will be in a different pr.

See: #2210.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2024
@ArniStarkware ArniStarkware deleted the arni/infra_utils/error_handle_file_not_found branch November 28, 2024 13:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants