Skip to content

Remove AppConstants #24294

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

Merged
merged 19 commits into from
Mar 24, 2025
Merged

Remove AppConstants #24294

merged 19 commits into from
Mar 24, 2025

Conversation

kean
Copy link
Contributor

@kean kean commented Mar 21, 2025

Self-explanatory.

To test:

  • Both apps don't crash
  • Verify line-by-line that the values were moved accurately, please

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@kean kean added the General label Mar 21, 2025
@kean kean added this to the 25.9 milestone Mar 21, 2025
@kean kean requested review from crazytonyli and mokagio March 21, 2025 23:33
@kean kean force-pushed the task/remove-app-constants branch from 0335064 to 7cc3758 Compare March 22, 2025 00:53
)
zendeskSourcePlatform = bundle.infoValue(forKey: "WPZendeskSourcePlatform")
mobileAnnounceAppID = bundle.infoValue(forKey: "WPMobileAnnounceAppID")
authKeychainServiceName = bundle.infoValue(forKey: "WPAuthKeychainServiceName")
Copy link
Contributor

Choose a reason for hiding this comment

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

All of these are just hard-coded values which don't have anything to do with build configurations. Maybe we can just have some readonly variables or something? I don't think all these values need to be in the Info.plist files.

Copy link
Contributor

Choose a reason for hiding this comment

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

All of these are just hard-coded values which don't have anything to do with build configurations

True. However, they do change from WordPress and Jetpack. Maybe we could derive them from brand/WPAppBrand. But then we'd have sort of two places where to place the values: Info.plist and the code switch brand { case ... here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

two places where to place the values: Info.plist and the code switch brand { case ... here.

💯. The idea is to specify configuration in data: Info.plist and .xcconfig. It's not always feasible, but you generally shouldn't have to search the codebase to find these values – it should be in configuration files, in data. I used switch brand sparingly.

There are multiple advantages to storing these values in data and not code: easier to find, can be modified without recompiling the app, easier to edit with scripts if needed.

@mokagio
Copy link
Contributor

mokagio commented Mar 24, 2025

I think I know why the builds are failing...


Update: Finally got CI validation #24297

Base automatically changed from task/remove-app-constants-strings to trunk March 24, 2025 14:27
@dangermattic
Copy link
Collaborator

dangermattic commented Mar 24, 2025

1 Warning
⚠️ This PR is assigned to the milestone 25.9. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 24, 2025

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr24294-4b6cb2f
Version25.8
Bundle IDorg.wordpress.alpha
Commit4b6cb2f
App Center BuildWPiOS - One-Offs #11818
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 24, 2025

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr24294-4b6cb2f
Version25.8
Bundle IDcom.jetpack.alpha
Commit4b6cb2f
App Center Buildjetpack-installable-builds #10841
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@kean kean requested a review from pmusolino March 24, 2025 17:02
@kean kean enabled auto-merge March 24, 2025 17:20
Copy link
Contributor

@pmusolino pmusolino left a comment

Choose a reason for hiding this comment

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

I just did a general smoke test, and I didn't find any crashes 👍

<key>WPProductBlogURL</key>
<string>wordpress.org/news/</string>
<key>WPZendeskSourcePlatform</key>
<string>mobile_-_ios</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be mobile_-_wp_ios? Is there a reason why we do not identify the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kean kean added this pull request to the merge queue Mar 24, 2025
Merged via the queue into trunk with commit 474abd4 Mar 24, 2025
25 checks passed
@kean kean deleted the task/remove-app-constants branch March 24, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants