Skip to content

Conversation

randhircs
Copy link
Contributor

@randhircs randhircs commented Jul 31, 2025

What are you trying to accomplish?

We have a community PR to pass sorbet related spec we need to add Sorbet type strict for this file in updater.

Anything you want to highlight for special attention from reviewers?

It should pass all test cases.

How will you know you've accomplished your goal?

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@randhircs randhircs requested a review from a team as a code owner July 31, 2025 20:58
@randhircs randhircs force-pushed the randhircs/sorbet-fix-to-fix-community-pr-issue branch from 299be00 to 1103afd Compare July 31, 2025 21:03
@kbukum1 kbukum1 force-pushed the randhircs/sorbet-fix-to-fix-community-pr-issue branch from 1103afd to d24f751 Compare July 31, 2025 22:03
@@ -86,41 +98,50 @@ def create_file_fetcher(directory: nil)
args = {
source: job.source.clone.tap { |s| s.directory = directory_to_use },
credentials: credentials,
options: job.experiments
options: T.unsafe(job.experiments)
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be a mismatch with the return type of job.experiments. We should create an investigation issue to track this.

Currently, job.experiments returns a hash with symbolized keys (Hash[Symbol, String]), but FileFetcher::Base expects its options parameter to be of type Hash[String, String], which leads to a type incompatibility.

Before taking action, we should confirm whether passing experiments to the file fetcher is actually causing any runtime issues. Once that's clear, we’ll need to figure out how to reconcile the Sorbet types—especially since both FileFetcher::Base and Job are used across all ecosystems and shared code.

Copy link
Contributor Author

@randhircs randhircs Aug 1, 2025

Choose a reason for hiding this comment

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

@kbukum1 We are able to transformed the values from Symbol to String and in that way it makes sure that there will not be any runtime type check error. So we may not need to monitor it.

Copy link
Contributor

@kbukum1 kbukum1 Aug 1, 2025

Choose a reason for hiding this comment

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

Can we solve the transforming keys in another PR? It is not related to this PR??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel this PR is ok have this transforming because we are adding sorbet fix and instead of adding unsafe but to transform it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should remove that from here. Because in case we got error from this, we want to only revert the transforming, not the whole PR. Also PR is not mentioning or explaining what is solving in this situation. Also do you have a business logic error that you can refer why you are doing this change?

@randhircs randhircs self-assigned this Aug 1, 2025
Copy link
Contributor

@markhallen markhallen left a comment

Choose a reason for hiding this comment

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

The sorbet types look fine. Good work.

It would be nice if we could get rid of some of the existing disabled cops, but at the very least we should try to avoid adding more disable cop comments.

# prefer credentials directly from the root of the file (will contain secrets) but if not specified, fall back to
# the job's credentials-metadata that has no secrets
# Convert experiments hash to have string keys and string values
experiments_options = job.experiments.transform_keys(&:to_s).transform_values(&:to_s)
Copy link
Contributor

@kbukum1 kbukum1 Aug 1, 2025

Choose a reason for hiding this comment

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

This should be removed, because it is not related to sorbet typings and it is change for business logic. It should be handled separately. You can find related comment here: #12761 (comment)

@randhircs randhircs requested a review from kbukum1 August 1, 2025 19:19
… He wants it to add it in separate PR. For this PR I am using T.unsafe to filter sorbet type check.
@randhircs randhircs merged commit 4a4b1ad into main Aug 4, 2025
149 of 153 checks passed
@randhircs randhircs deleted the randhircs/sorbet-fix-to-fix-community-pr-issue branch August 4, 2025 21:47
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.

3 participants