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

Make team id a local configuration #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

subdigital
Copy link

@subdigital subdigital commented Dec 17, 2024

What does this change accomplish?

Developers have to change the team ids in order to build in Xcode and then have to remember to revert these changes before submitting a PR. This moves the definition of DEVELOPMENT_TEAM into a config file that is gitignored.

A bootstrap script is provided to make getting set up easier.

How can the change be tested?

Checkout this branch
Run ./setup_team.sh
Build in Xcode

For internal developers, just Build with Xcode and it will populate the file for you with Shopify's Team ID.

Developers have to change the team ids in order to build and then have to remember to revert these changes before submitting a PR. This moves the definition of DEVELOPMENT_TEAM into a config file that is gitignored.

A bootstrap script is provided to make getting set up easier.
Comment on lines +100 to +101

Configurations/TeamID.xcconfig
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, we definitely want to default to the team ID being populated so that our internal teams do not need to redundantly enter own team ID every time.

Can we move the development team configuration to a configuration file so that it can be configured from one place? And then just offer instructions on how to clear it or change it?

Copy link
Author

Choose a reason for hiding this comment

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

This would be a one-time thing per checkout. The main thing (for me and other non-Shopify contributors) is that we will perpetually need to dirty this file.

We could perhaps have an Xcode pre-build step check for the file and it doesn't exist, seed it with the Shopify team id. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

What if we had a third build configuration for external contributions (inheriting from Debug settings), that referenced a separate ignored xcconfig file?

Copy link
Author

Choose a reason for hiding this comment

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

There is no way (that I know of) to conditionally include an xcconfig file if it exists. So this would end up causing a build error and you'd have to create the file manually (or via a script)

Copy link
Member

@lfroms lfroms Dec 18, 2024

Choose a reason for hiding this comment

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

That's kind of what I was thinking. Would it be okay to produce an error until the file is created? That would only need to be done once, right?

I'm open to ideas but I'd like to prioritize a no-setup experience for internal contributors.

bootstrap.sh is now setup_team.sh and can take a 'default' argument.
Xcode will call this script if the xcconfig file is not present on
disk, making it a zero-setup process for internal contributors.

External contributors will need to run setup_team.sh once to set
up their own team id.
@subdigital
Copy link
Author

@lfroms I pushed a change that addresses what you want. Take a look at 3a69a5c.

Shopify folks won't have to do anything, external contributors run the script one time.

@subdigital
Copy link
Author

Hi @lfroms, did you have a chance to review this?

Copy link
Member

@lfroms lfroms left a comment

Choose a reason for hiding this comment

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

Sorry @subdigital! I was out of office.

I'm liking the direction, but could we avoid removing the defaults from the project files and instead use a script to assign empty values in an xcconfig for external contributors? This way no action is required for internal contributors, and external contributors only need to run one script to prepare the project. Should remove the need for an extra script action as well.

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