Skip to content

Add FXIOS-27112 Update FirefoxTelemetryUtility.sh to automatically update tags.yaml #27279

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

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

Conversation

Marvae
Copy link
Contributor

@Marvae Marvae commented Jun 12, 2025

📜 Tickets

Github issue

💡 Description

Currently, when developers add new metrics using the FirefoxTelemetryUtility.sh script with the --add option, they need to manually update the tags.yaml file. This manual step can lead to errors if forgotten and causes glean_parser compiler errors in Xcode.

Changes

  1. Added a new update_tags_yaml function to handle tag updates
  2. Modified the --add command to accept an optional description parameter
  3. Updated the script's usage documentation with examples
  4. Added proper error handling for duplicate tags

📝 Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If adding telemetry, I read the data stewardship requirements and will request a data review
  • If needed, I updated documentation and added comments to complex code
  • If needed, I added a backport comment (example @Mergifyio backport release/v120)

…and alphabetize the tags.yaml for -add operations
@Marvae Marvae requested a review from a team as a code owner June 12, 2025 12:24
@Marvae Marvae requested a review from PARAIPAN9 June 12, 2025 12:24
@Marvae
Copy link
Contributor Author

Marvae commented Jun 12, 2025

@ih-codes Please take a look!

@PARAIPAN9 PARAIPAN9 requested a review from ih-codes June 12, 2025 12:35
Copy link
Collaborator

@ih-codes ih-codes left a comment

Choose a reason for hiding this comment

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

This is great work @Marvae! Thank you very much for taking this on. I appreciate the detailed documentation changes you made as well. 🚀

I tested your changes and just found one edge case with appending to the end of the tags.yaml file. Maybe you can take a look? Thanks!

@mobiletest-ci-bot
Copy link

Messages
📖 Edited 1 files
📖 Created 0 files

Generated by 🚫 Danger Swift against 8d6095e

Copy link
Collaborator

@ih-codes ih-codes left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes @Marvae! Works great when I tested. 👌 I had just one tiny nitpick for the appending extra newlines to the end of the tags.yaml.

Example output:

Toasts:
  description: Corresponds to any events around toasts in the app. Toasts are the shortlived banners that 
    appear when an action is taken.

TopSites:
  description: Corresponds to the [Feature:TopSites](https://mozilla-hub.atlassian.net/browse/FXIOS-3464)
    label on GitHub.

XTag:
  description: TODO: Add description for XTag tag


YTag:
  description: TODO: Add description for YTag tag


ZTag:
  description: TODO: Add description for ZTag tag

echo "" >> "$temp_file"
echo "${tag_name}:" >> "$temp_file"
echo " description: ${tag_description}" >> "$temp_file"
echo "" >> "$temp_file"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
echo "" >> "$temp_file"

I think we can delete this ending newline. As long as we make sure tags.yaml always has a newline at the end, then we can just prepend the one newline on 269 before appending the newest tag.

Otherwise if you keep appending new tags right to the end of the file you'll get double spaces between tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the throughout test! Updated

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.

3 participants