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

fix(forge): disable artifacts for coverage #9692

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

yash-atreya
Copy link
Member

Motivation

Closes #8840

Saves coverage artifacts and build-info to a separate directory out/coverage and out/coverage/build-info respectively. This prevents users from mistakenly deploying unoptimized contracts, see: #8840 (comment)

Solution

Artifacts generated by forge coverage are written to out/coverage.

@yash-atreya yash-atreya added T-feature Type: feature C-forge Command: forge T-likely-breaking Type: requires changes that can be breaking labels Jan 16, 2025
@yash-atreya yash-atreya marked this pull request as draft January 16, 2025 12:32
@yash-atreya yash-atreya marked this pull request as ready for review January 16, 2025 13:34
@klkvr
Copy link
Member

klkvr commented Jan 16, 2025

should we just flip the second bool here?

let mut project = config.create_project(false, false)?;

coverage should not write any artifacts given that it already disables cache

@yash-atreya
Copy link
Member Author

should we just flip the second bool here?

let mut project = config.create_project(false, false)?;

coverage should not write any artifacts given that it already disables cache

While not in this PR, I'd like to enable caching for coverage (backlog from: #9366). Moreover, I think that would be severely breaking for any external workflows that users have ?? cc @grandizzy @zerosnacks

@grandizzy
Copy link
Collaborator

should we just flip the second bool here?

let mut project = config.create_project(false, false)?;

coverage should not write any artifacts given that it already disables cache

While not in this PR, I'd like to enable caching for coverage (backlog from: #9366). Moreover, I think that would be severely breaking for any external workflows that users have ?? cc @grandizzy @zerosnacks

I think in scope of solving issue here #8840 (comment) flipping no_artifacts to true makes sense (indeed could be breaking for existing flows but better to break instead having wrong assumptions as pointed out in comment) . If we want to enable caching then IMO PR changes are OK but maybe we could also set both cached and no_artifacts to true?

@yash-atreya
Copy link
Member Author

@grandizzy

I think in scope of solving issue here #8840 (comment) flipping no_artifacts to true makes sense

Makes sense. Can flip no_artifacts to true for this PR and merge.

@yash-atreya yash-atreya marked this pull request as draft January 17, 2025 05:59
@yash-atreya yash-atreya marked this pull request as ready for review January 17, 2025 07:23
@yash-atreya
Copy link
Member Author

@grandizzy @klkvr ptal

Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

lgtm!

@yash-atreya yash-atreya changed the title feat(forge): diff artifacts dir for coverage feat(forge): disable artifacts for coverage Jan 17, 2025
@yash-atreya yash-atreya changed the title feat(forge): disable artifacts for coverage fix(forge): disable artifacts for coverage Jan 17, 2025
@yash-atreya yash-atreya self-assigned this Jan 20, 2025
@grandizzy grandizzy merged commit 423644e into master Jan 21, 2025
22 checks passed
@grandizzy grandizzy deleted the yash/separate-cov-artifacts-dir branch January 21, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-feature Type: feature T-likely-breaking Type: requires changes that can be breaking
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

chore: warn optimization is disabled when forge coverage is called
4 participants