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

Enable third-party podspec sources to be fetched from mirrored git repositories #45566

Conversation

RailByteOEBB
Copy link
Contributor

@RailByteOEBB RailByteOEBB commented Jul 22, 2024

Summary:

At OEBB we currently facing an issue we're not able to use our mirrored git repositories for third-party podspecs. This is due to the fact podspecs contain hardcoded git repository urls. With this change we could specify urls to our mirrored git repositories.

Changelog:

[IOS] [ADDED] Enable third-party podspec sources to be fetched from mirrored git repositories

Test Plan:

# Define env vars for git mirrors

export FMT_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export GLOG_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export FOLLY_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export DOUBLE_CONVERSION_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"
export BOOST_GIT_URL="https://my-git-host.com/my-mirrored-repo.git"

# Pod install command run from ios app folder 
pod install

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jul 22, 2024
@cipolleschi
Copy link
Contributor

Hi @RailByteOEBB, thanks for the proposal.
I do understand your use case, but I don't really like the idea of having those ENV var spread across the codebase.

I think that it would be better if we find a different way to handle this.

one way to go could be:

  • from the react_native_pods.rb file, we export a function that returns the repository given the name of the pod
  • the pods consume that function, so the code is clean and polished
  • we find a way to define those mirrors in the Podfile, so there is no need for environment variables.
    what do you think?

@RailByteOEBB
Copy link
Contributor Author

Hi @cipolleschi, thanks for your quick response.

I would propose the following solution:

  • Adding default values foreach third party dependency in helpers.rb as it's currently done with folly. E.g Helpers::Constants.folly_config
  • Adding getter and setter functions to react_native_pods.rb similar to current existing solution for folly get_folly_config .
    • The setter function would override the specified default values in helpers.rb
  • The setter function would be callable from podfile of the application. One could override it like set_glog_config(mirrored_url)

What do you think?

@cipolleschi
Copy link
Contributor

@RailByteOEBB sorry for the late reply!
Yep, the approach can work, if you are up for the changes, we can then test them and upstream them.

@RailByteOEBB
Copy link
Contributor Author

Hi @cipolleschi,

thanks for your reply. I've implemented the changes. May I ask you to review it again?

Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

great job, thanks for working on it.

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 14, 2024
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 53969cb.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @RailByteOEBB in 53969cb

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants