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: 2024 updates and Node20 support #538

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

kxc171
Copy link
Contributor

@kxc171 kxc171 commented Jun 26, 2024

This PR updates this Action to include all of the recent changes in the actions/typescript-action template repository, such as Linting, Packages, Workflows, moving to Node20, etc. The goal is to get things updated to 2024 standards in hopes of enabling other open-source developers to more easily contribute. 😇

In addition to this, some of the code was refactored to better support more of the API and address Issues #536, #537. I also added real test cases for the parsing function of this Action - I'm not familiar enough with jest and mocking HTTP calls, so I didn't expand on the tests cases too much.

PASS __tests__/index.test.ts
  index
    ✓ calls run when imported (25 ms)

PASS __tests__/dynatrace.test.ts
  dynatrace
    ✓ returns a safe key (6 ms)
    ✓ returns a safe value (1 ms)
    ✓ converts a Metric to line protocol
    ✓ can add a format to a Metric (17 ms)
    ✓ prevents invalid Metric formats (37 ms)
    ✓ converts an Event to its payload (1 ms)
    ✓ can add a startTime and endTime to an Event
    ✓ prevents invalid Event types (2 ms)

The README has also been cleaned up a bit with proper inputs and explanations.

I understand there are a lot of changes in this PR, but this repo has been behind for a few years now so there was a lot of updates since then. I have confirmed these changes work in my organization and confirmed that there are no changes needed by the users consuming the Action. The only change is that the Action will FAIL if an invalid Metric/Event comes up or if we do not get a 202 back from Dynatrace - this is so things are clear to the user and they can take action to correct it.

check-dist.yaml

This will ensure the dist/ directory is updated as part of any PR or commit into main. This was from the template.

linter.yaml

Will run super-linter against the entire repo to ensure consistency. This was from the template.

ci.yaml

Will ensure that tests and linting passes on the TypeScript code. This was part of the template.

codeql.yaml

Will run CodeQL against the TypeScript codebase to check for any vulnerabilities. This was part of the template.

release.yaml

This is a small utility workflow that will let you create versioned released like v1.2.3 and have the tags v1.2 and v1 updated with them. Create a vX.Y.Z tag and this workflow will kick off - you can easily do this via the Releases page. I wanted to keep things simple so you can more easily manage this going forward.

@dynatrace-cla-bot
Copy link
Member

dynatrace-cla-bot commented Jun 26, 2024

CLA assistant check
All committers have signed the CLA.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@wolfgangB33r wolfgangB33r merged commit 74f765d into dynatrace-oss:main Jul 10, 2024
2 checks passed
@wolfgangB33r
Copy link
Collaborator

@kxc171 thx a lot for the pull request, i checked it and happily merged it today! thx again for all the effort you spent on updating the action to current state.

@kxc171 kxc171 deleted the feat/refactor-node20 branch July 10, 2024 12:18
@kxc171
Copy link
Contributor Author

kxc171 commented Jul 10, 2024

@wolfgangB33r - Fantastic, I'm glad it could get merged in and be of use!

You can probably cut a new v10.0.0 release/tag, which will create a v10.0.0, v10.0 and v10 tag so others can start using these changes. The existing v9 tag will remain the exact same for people.

@kxc171 kxc171 restored the feat/refactor-node20 branch July 10, 2024 12:56
@kxc171 kxc171 deleted the feat/refactor-node20 branch July 12, 2024 20:30
@kxc171 kxc171 mentioned this pull request Jul 16, 2024
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