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

Add usage event when iOS app is archived #108643

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Jul 29, 2022

Add usage event within flutter assemble when the app is being archived. This should cover the flutter tool flutter build ipa as well as the in-Xcode archiving.

The event is category=assemble, parameter=ios-archive, label=success or fail.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Jul 29, 2022
@jmagman jmagman self-assigned this Jul 29, 2022
@flutter-dashboard flutter-dashboard bot added the team Infra upgrades, team productivity, code health, technical debt. See also team: labels. label Jul 29, 2022
outputDir: fileSystem.directory('/output'),
buildDir: fileSystem.directory('/build'),
projectDir: fileSystem.directory('/project'),
final Environment result = Environment.test(
Copy link
Member Author

Choose a reason for hiding this comment

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

Switched to Environment.test to pick up the defaults, including usage.

@@ -247,7 +253,7 @@ void main() {
);

await const ReleaseIosApplicationBundle().build(environment);
expect(processManager.hasRemainingExpectations, isFalse);
expect(processManager, hasNoRemainingExpectations);
Copy link
Member Author

Choose a reason for hiding this comment

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

use hasNoRemainingExpectations instead of processManager.hasRemainingExpectations, isFalse to get helpful debugging logging about which expectations are remaining.

Copy link
Member Author

Choose a reason for hiding this comment

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

Follow up: #108649

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

environment.logger.printTrace('Sending archive event if usage enabled.');
UsageEvent(
'assemble',
'ios-archive',
Copy link
Member

Choose a reason for hiding this comment

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

Should we have an analogous event on the Android (, desktop, web, ...) side?

Copy link
Member Author

Choose a reason for hiding this comment

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

Does flutter build apk already fully cover Android? Or does it have the same issue where it can be bundled and released without flutter? Web seems to say "upload a release version" which means the tool may not know if the app is being "published" or just being built in release mode. Windows and Linux both have publication instructions outside of the tool, so that may benefit from a similar pattern to this, if assemble is called, and there's some way to know it's being packaged. Each platform would need individual investigation.

@zanderso
Copy link
Member

zanderso commented Aug 1, 2022

@eliasyishak FYI only to see a patch that adds some analytics collection, no action needed.

camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-ios iOS applications specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants