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

C++: Add feature flag for TRAP caching. #2087

Merged
merged 4 commits into from
Jan 22, 2024
Merged

Conversation

sashabu
Copy link
Contributor

@sashabu sashabu commented Jan 15, 2024

Merge / deployment checklist

@sashabu sashabu requested a review from a team as a code owner January 15, 2024 18:21
@sashabu sashabu force-pushed the sashabu/cpp-trap-caching branch 4 times, most recently from 5b305cc to 983b5fc Compare January 15, 2024 20:28
@sashabu sashabu requested a review from henrymercer January 17, 2024 15:58
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Thanks, two further comments:

  • TRAP caching enablement should probably depend on a few other things. We have an explicit input for disabling TRAP caching, which we should respect. This is used in getTrapCachingEnabled(). This function also disables TRAP caching if we're running on a self-hosted runner where the connection to the artifact store might be slow. The only complication with reusing this function is that we probably want to let the trap-caching input override the value of the feature flag.
  • We may want to set minimumVersion on the feature flag to avoid printing a log message like "Enabling CodeQL C++ TRAP caching support" when running against an old CLI that doesn't support TRAP caching.

@sashabu
Copy link
Contributor Author

sashabu commented Jan 17, 2024

we probably want to let the trap-caching input override the value of the feature flag.

I don't think we do: the feature flag is intended for a gradual rollout rather than long-lived, so I think we do want the feature flag to override it. (And if I understand correctly, CODEQL_CPP_TRAP_CACHING will set the feature flag, so customers would have some control if they need to.)

  • We may want to set minimumVersion on the feature flag to avoid printing a log message like "Enabling CodeQL C++ TRAP caching support" when running against an old CLI that doesn't support TRAP caching.

We're not using the environment variable in production yet (or turning the feature flag on). What's the right way to go about minimumVersion in this case? Last release, next release, leave undefined for now and fix later, hold off merging this PR?

@sashabu sashabu force-pushed the sashabu/cpp-trap-caching branch from aad9182 to c86df54 Compare January 17, 2024 16:38
@henrymercer
Copy link
Contributor

henrymercer commented Jan 17, 2024

I don't think we do: the feature flag is intended for a gradual rollout rather than long-lived, so I think we do want the feature flag to override it. (And if I understand correctly, CODEQL_CPP_TRAP_CACHING will set the feature flag, so customers would have some control if they need to.)

That's fair — the expectation for trap-caching: true could be that TRAP caching is enabled for all languages for which it's GA. However I do think trap-caching: false should override the feature flag, as this is a signal that the customer does not want us to populate Actions cache (typically because they are using it for something else and don't want their other caches to be evicted).

We're not using the environment variable in production yet (or turning the feature flag on). What's the right way to go about minimumVersion in this case? Last release, next release, leave undefined for now and fix later, hold off merging this PR?

I think we should probably hold off on merging this PR until we know what the minimum CLI version is that we'd want to enable this for. The alternative is to add an entry to the features property of codeql version and check for that in the Action instead of using a version number.

@sashabu
Copy link
Contributor Author

sashabu commented Jan 17, 2024

However I do think trap-caching: false should override the feature flag, as this is a signal that the customer does not want us to populate Actions cache (typically because they are using it for something else and don't want their other caches to be evicted).

Agreed. My last commit should do that.

I think we should probably hold off on merging this PR until we know what the minimum CLI version is that we'd want to enable this for.

👍

@sashabu sashabu marked this pull request as draft January 17, 2024 17:44
@sashabu sashabu force-pushed the sashabu/cpp-trap-caching branch 2 times, most recently from 85ff45a to 4433a33 Compare January 19, 2024 17:29
@sashabu sashabu marked this pull request as ready for review January 19, 2024 17:45
@sashabu sashabu requested a review from henrymercer January 19, 2024 17:46
henrymercer
henrymercer previously approved these changes Jan 19, 2024
@sashabu sashabu enabled auto-merge January 19, 2024 19:57
@sashabu sashabu force-pushed the sashabu/cpp-trap-caching branch from 4433a33 to d0c5ea0 Compare January 22, 2024 13:04
auto-merge was automatically disabled January 22, 2024 13:10

Pull Request is not mergeable

@sashabu sashabu enabled auto-merge January 22, 2024 14:14
@sashabu sashabu requested a review from henrymercer January 22, 2024 14:15
@sashabu sashabu merged commit c6fd1aa into main Jan 22, 2024
317 checks passed
@sashabu sashabu deleted the sashabu/cpp-trap-caching branch January 22, 2024 14:25
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.

2 participants