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

refactor: clean up types slightly (drop GenericSpan, s/agent./apm./ namespace) #2300

Merged
merged 1 commit into from
Aug 25, 2021

Conversation

trentm
Copy link
Member

@trentm trentm commented Aug 24, 2021

  • Drop the "GenericSpan" interface in our types. It isn't an external
    concept and there wasn't a lot of utility in using inheritance for it
    in the types file.
  • Change from 'agent.' to 'apm.' usage in the types test file because
    'apm' is the prefix we encourage in docs (for good reason I think, it
    is less ambiguous).

This is a follow up to the types changes in #2119. I avoided this refactoring for that PR to keep the diff size down.

Checklist

… docs

- Drop the "GenericSpan" interface in our types. It isn't an external
  concept and there wasn't a lot of utility in using inheritance for it
  in the types file.
- Change from 'agent.' to 'apm.' usage in the types test file because
  'apm' is the prefix we encourage in docs (for good reason I think, it
  is less ambiguous).
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Aug 24, 2021
@apmmachine
Copy link
Contributor

apmmachine commented Aug 24, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-08-24T17:01:22.498+0000

  • Duration: 3 min 22 sec

  • Commit: 9755b41

Trends 🧪

Image of Build Times

@trentm trentm marked this pull request as ready for review August 24, 2021 16:50
@trentm trentm requested a review from astorm August 24, 2021 16:50
@trentm
Copy link
Member Author

trentm commented Aug 24, 2021

I'm considering the checks green. The failure of Integration Tests is the unrelated, ongoing elastic/apm-integration-testing#1188

Copy link
Contributor

@astorm astorm left a comment

Choose a reason for hiding this comment

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

Approving, with the caveat that all the use cases for these types aren't clear to me and I'll be curious to see if removing with type causes any weird downstream issues.

@@ -127,31 +127,27 @@ declare namespace apm {
setSpanOutcome(outcome: Outcome): void;
}

type Outcome = 'unknown' | 'success' | 'failure'
type Outcome = 'unknown' | 'success' | 'failure';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessary for this PR -- but seeing the added ; makes me wonder if we want to get some sort of auto-fix linter looking at these typescript files as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yah, agreed it would be nice, but I didn't want to go there in this PR.

@trentm trentm merged commit e1a9a79 into master Aug 25, 2021
@trentm trentm deleted the ts-follow-up branch August 25, 2021 17:01
dgieselaar pushed a commit to dgieselaar/apm-agent-nodejs that referenced this pull request Sep 10, 2021
… docs (elastic#2300)

- Drop the "GenericSpan" interface in our types. It isn't an external
  concept and there wasn't a lot of utility in using inheritance for it
  in the types file.
- Change from 'agent.' to 'apm.' usage in the types test file because
  'apm' is the prefix we encourage in docs (for good reason I think, it
  is less ambiguous).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants