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

Validate that telemetry definitions are ordered alphabetically; Reorder the current file #705

Merged
merged 8 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/lint-telemetry-definitions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint Telemetry Definitions
Copy link
Contributor

@justinmk3 justinmk3 Mar 1, 2024

Choose a reason for hiding this comment

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

could be just "Lint", all linting can be in one CI place

Suggested change
name: Lint Telemetry Definitions
name: Lint

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer to parallelize all of the linting, having each job focus on its own domain. We only have the one thing being linted in CI, and it's easy to change course though. Let's leave it as-is for now.

on:
push:
branches: [main]
pull_request:
branches: [main, feature/*]

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Sync Code
uses: actions/checkout@v3

- name: Compile the Validation code
run: |
cd telemetry/validation
npm ci
npm run build
npm run test

- name: Validate the telemetry definitions
run: |
cd telemetry/validation
npm run validate
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build
.gradle
.idea
**/node_modules
**/dist
**/out
**/*.tgz
.testresults/**
Expand Down
10 changes: 10 additions & 0 deletions telemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,17 @@ and change `name`, `description`, and the values in `allowedValues`

Then rerun the generator. This example will generate a new type that can be imported or used in telemetry calls.

CI jobs run validation checks on the telemetry definitions file. For example, entries are expected to exist in alphabetical order. You may want to check this yourself before creating a PR, by switching to the `telemetry/validation` folder, and running:

```
npm install
npm run validate
```

You can also run `npm run fix` to apply simple fixes to the file (like re-ordering).

### Overriding existing telemetry
justinmk3 marked this conversation as resolved.
Show resolved Hide resolved

In VSCode and JetBrains, extra telemetry files will take precedence over existing definitions. For example, if you have a metric for `lambda_update`, adding another `lambda_update` in the repo's extra telemetry files will override all of the values of it.

Types work similarly, and will also be overwritten by extra telemetry files.
Expand Down
Loading
Loading