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

Automation refactors to better support Enterprise builds #1749

Merged
merged 10 commits into from
May 15, 2024

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented May 14, 2024

I'm looking at setting up prototype builds, which we'll use for internal testing and distribute via Automattic's Enterprise account. Internal ref pdnsEh-1D4-p2.

This PR does some refactors that aims to make it easier to add support for this upcoming new build.

Highlights:

  • Use api_key instead of api_key_path.
  • Extract extension names so we can easily define the bundle identifiers for the prototype build version once ready.
  • Rename some constants and lanes to include "production" do distinguish them from the prototype build version (staging?) in the future

To test

If CI is green, then the refactor is correct.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary. — N.A.
  • I have considered adding unit tests for my changes. — N.A.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics. — N.A.

@mokagio mokagio requested a review from a team as a code owner May 14, 2024 11:45
@mokagio mokagio requested review from leandroalonso and removed request for a team May 14, 2024 11:45
@mokagio mokagio added this to the 7.65 milestone May 14, 2024
@mokagio mokagio added the [Type] Tooling Issues related to tooling: build tools, ruby, scripts, etc. label May 14, 2024
fastlane/Fastfile Outdated Show resolved Hide resolved
team_id: TEAM_ID,
app_identifier: MAIN_BUNDLE_IDENTIFIERS
team_id: TEAM_ID_PRODUCTION,
app_identifier: PRODUCTION_BUNDLE_IDENTIFIERS
)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These last calls come from register_new_device, a lane that adds devices to the ASC account. We've long since improved this workflow via internal tooling. @Automattic/pocket-casts-ios is it okay to remove register_new_device?

Copy link
Contributor

Choose a reason for hiding this comment

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

This obsolete lane also has the big drawback that any device registered using it would not be claimed and associated with the Matticspace user the device belongs to (and thus would be removed like any other unclaimed device when we do our yearly cleanup too). So 💯 to remove that lane.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in #1758

@mokagio mokagio requested a review from a team May 14, 2024 12:03
Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

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

Overall looks good, except the constant at the global scope having side effects (potentially making the Fastfile crash if the env vars are not defined locally… even when running a lane that don't need to interact with the ASC API and won't need that API key at all)

fastlane/Fastfile Outdated Show resolved Hide resolved
team_id: TEAM_ID,
app_identifier: MAIN_BUNDLE_IDENTIFIERS
team_id: TEAM_ID_PRODUCTION,
app_identifier: PRODUCTION_BUNDLE_IDENTIFIERS
)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

This obsolete lane also has the big drawback that any device registered using it would not be claimed and associated with the Matticspace user the device belongs to (and thus would be removed like any other unclaimed device when we do our yearly cleanup too). So 💯 to remove that lane.

Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

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

I didn't test to confirm but I'm assuming you updated the env vars in .mobile-secrets too; if so, :shipit:

@mokagio
Copy link
Contributor Author

mokagio commented May 15, 2024

I didn't test to confirm but I'm assuming you updated the env vars in .mobile-secrets too; if so, :shipit:

Yes I did. But it doesn't hurt to test in the real world. I should have thought of that.

See https://buildkite.com/automattic/pocket-casts-ios/builds/6900#018f7b31-f65d-437c-91bf-b214ed8101c3

@mokagio mokagio merged commit 1c7b952 into trunk May 15, 2024
4 checks passed
@mokagio mokagio deleted the mokagio/prototype-builds-prep branch May 15, 2024 07:44
@mokagio
Copy link
Contributor Author

mokagio commented May 15, 2024

Breadcrumb for future reference. I just realized that CI is fine because it has the env vars, but a developer machine might not.

I'll followup tomorrow with a PR that sets up the .env pattern to account for local builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Tooling Issues related to tooling: build tools, ruby, scripts, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants