-
Notifications
You must be signed in to change notification settings - Fork 68
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
feat: webclient version and installation method #321
feat: webclient version and installation method #321
Conversation
5521627
to
5df1fb0
Compare
a32d477
to
3cdd2ba
Compare
3d7e2d9
to
5a54bb3
Compare
update-version.sh
Outdated
#!/bin/bash | ||
|
||
version=$(jq -r '.version' package.json) | ||
jq --arg version $version '.version |= $version' version.json >file.json.tmp && cp file.json.tmp version.json |
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.
question: Why do we need to write to file.json.tmp
first?
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.
If we write directly to the version.json
file, it appends onto the content instead of overwriting the file so we have to write to a temp file and then copy the file over to overwrite the existing file.
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.
Given we're ignoring the version.json file and removed file from changes, I updated the script so that we just write to a new file.
package.json
Outdated
@@ -29,7 +29,7 @@ | |||
"build:dist:es": "tsc --project ./tsconfig.es.json", | |||
"build:dist:cjs": "tsc --project ./tsconfig.cjs.json", | |||
"build:assets": "npm-run-all -p build:dist:* build:webpack:prod", | |||
"build": "npm-run-all -s build:schemas build:assets", | |||
"build": "npm-run-all -s build:schemas update:version build:assets", |
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.
suggestion: If we run any of the targets independently, like npm run build:dist:es
, then the correct version may not be used.
This is fine for the deployment script in this repository, because it runs build
, but there is are scenarios where this step could be missed. For example, a third party runs their own web client build, but runs only the subset they need: build:schemas && build:dist:es
.
One way to help mitigate this would be to omit version.json
from version control (by adding it to .gitignore
). This way, like the schemas, build:version
would need to run before the other build steps, helping ensure the file is up to date.
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.
Added to .gitignore
and removed files from changes
Currently, AWS RUM has no way to determine how RUM users are installing the web client or the version of the installed web client. This update will add this information to the metadata of all events. The web client version will be stored in a new built-in field,
aws:clientVersion
, while the installation method will be stored in a new built-in field,aws:client
.This update also updates the deployment script to track all official web client versions in a file located in the S3 bucket in the AWS RUM service account (
content/versions.csv
).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.