-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bug 1914647 - Using browser tests to collect JSON for live messages #370
Conversation
✅ Deploy Preview for fxms-skylight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. r=dmose, once this import script aborts if it sees that the keys aren't in reverse order.
lib/mergeASRouterData.js
Outdated
// Add any message data with an id that does not already exist in data.json | ||
for (let i = 0; i < json_data.length; i++) { | ||
if (!json_result.find((x) => x.id === json_data[i].id)) { | ||
json_result.push(json_data[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- the first version read always wins (which is fine if releases stay in decreasing order) - abort script if wrong order, comment near this code that it depends on this ordering
- the preview will always be of the latest released version, even though metrics will cover multiple (possibly all) versions (future epic)
- will need similar algorithm for merge looker data with this data and eventually remote settings data (can be part of spike PR - make note in spike PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of aborting script, I just ended up sorting the list in descending order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment that this will need to be checked once if/when we add dot-versions (129.0.1), since I'm not sure how sort's default collation order will handle that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also had to update the script to start with a basically empty data.json
(including the default about welcome message that we need to manually add) to account for when newer releases are being added so that they are prioritized first and not being overwritten.
Before you land, could you add in 130 as well, since it's the current release version? I'd also be interested in your thoughts on how we keep this up-to-date. Might just be a repeating calendar entry or something... |
Yeah, I feel like a repeating calendar entry for every release makes the most sense |
lib/mergeASRouterData.js
Outdated
}); | ||
console.log(availableReleases); | ||
|
||
const manualMessages = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify why this needs to be manual, and how we go about updating it with each new release? My suspicion is that even if we need to do some kind of hack to get the data, that hack probably wants to go in the browser test itself, so that we always get the current version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just talked to @AllegroFox and we figured out how to get the about welcome default message data into the browser test! I'll be pushing my changes soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased my new changes to the browser test and you can see them here https://phabricator.services.mozilla.com/D201646
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, looks good, once the noted changes have been made. r=dmose
I've got some stuff in my calendar for early October to see if we can automate ticket creation for this with JIRA. I'll either do that in October, or fall back to manual calendaring.
lib/mergeASRouterData.js
Outdated
JSON.stringify([]), | ||
); | ||
|
||
availableReleases.map((release) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the interest of making the code easier to read, how about changing this from an anonymous lambda function to a named function with comments describing the expected behavior?
CONTRIBUTING.md
Outdated
mv /tmp/file.json ./{VERSION_NUM}-release.json | ||
``` | ||
|
||
6. Run [`lib/mergeASRouterData.js`](/lib/mergeASRouterData.js) using node to merge all the release data into one file. Make sure you include the latest version number you've just collected data from into the `availableReleases` array inside the script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please split this into two steps, with the first being to edit the script and add the version number, and the second step to run the script.
CONTRIBUTING.md
Outdated
|
||
6. Run [`lib/mergeASRouterData.js`](/lib/mergeASRouterData.js) using node to merge all the release data into one file. Make sure you include the latest version number you've just collected data from into the `availableReleases` array inside the script. | ||
|
||
**❗Important note**: Make sure to update the template for the `MR_WELCOME_DEFAULT` message inside `data.json` to "defaultaboutwelcome". This is currently a manual step we must perform to ensure that the message preview for this unique message is working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be deleted now, correct?
Bug 1914647
Changes made:
Things to consider for future patches: