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

@slack/web-api: prep for next major release. bump min node to v18 #1667

Merged
merged 1 commit into from Oct 5, 2023

Conversation

filmaj
Copy link
Contributor

@filmaj filmaj commented Oct 3, 2023

Summary

  • cleaning up the readme.
  • remove no longer used codecov and deno build npm run scripts.
  • update dependencies as much as possible.
  • fix linter errors.
  • remove a test that is no longer applicable with new axios.

I'd like to work on slowly getting the next 7.0 major release out, and this would be a good opportunity to eliminate EOL'ed node support while we are at it. I will be reviewing the existing issues for this package to see if we can tackle any other breaking changes while we are at it.

…eaning up the readme. remove no longer used codecov and deno build npm run scripts. update dependencies as much as possible. fix linter errors. remove a test that is no longer applicable with new axios.
@filmaj filmaj added semver:major pkg:web-api applies to `@slack/web-api` labels Oct 3, 2023
@filmaj filmaj requested a review from a team October 3, 2023 21:00
@filmaj filmaj self-assigned this Oct 3, 2023
@@ -34,20 +34,6 @@ describe('WebClient', function () {
assert.instanceOf(client, WebClient);
assert.notExists(client.axios.defaults.headers.Authorization);
});
it('should not modify global defaults in axios', function () {
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 didn't feel like this test offers much value and since this PR moves from axios 0.x to 1.x, also not sure how much we should be testing the output of other packages.

Copy link
Member

Choose a reason for hiding this comment

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

@filmaj As you can see, the context behind this unit test is #1037 This package had an issue polluting the global singleton instance of axios package. This test tries to prevent the same issue from occurring again. If axois 1.x does not allow such destructive operations to the global singleton, we can safely remove this test. Thus, I don't think we're testing 3rd party library here. We verify our package works without any major side effects.

If investigation on how to properly maintain this test with axios 1.x could require our time and efforts, it's fine to delete the test anyways. Whenever we have something similar in the future, we can add tests again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for checking this!

@@ -149,7 +135,6 @@ describe('WebClient', function () {
assert.equal(error.code, ErrorCode.RequestError);
assert.equal(error.original.config.timeout, timeoutOverride);
assert.equal(error.original.isAxiosError, true);
assert.equal(error.original.request.aborted, true);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In axios 1.0, this assertion no longer passes. Not sure how important that is. Let me know if you have opinions on that.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any issues with the deletion

@@ -34,20 +34,6 @@ describe('WebClient', function () {
assert.instanceOf(client, WebClient);
assert.notExists(client.axios.defaults.headers.Authorization);
});
it('should not modify global defaults in axios', function () {
Copy link
Member

Choose a reason for hiding this comment

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

@filmaj As you can see, the context behind this unit test is #1037 This package had an issue polluting the global singleton instance of axios package. This test tries to prevent the same issue from occurring again. If axois 1.x does not allow such destructive operations to the global singleton, we can safely remove this test. Thus, I don't think we're testing 3rd party library here. We verify our package works without any major side effects.

If investigation on how to properly maintain this test with axios 1.x could require our time and efforts, it's fine to delete the test anyways. Whenever we have something similar in the future, we can add tests again.

@@ -149,7 +135,6 @@ describe('WebClient', function () {
assert.equal(error.code, ErrorCode.RequestError);
assert.equal(error.original.config.timeout, timeoutOverride);
assert.equal(error.original.isAxiosError, true);
assert.equal(error.original.request.aborted, true);
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any issues with the deletion

@@ -94,7 +94,13 @@ export function httpErrorFromResponse(response: AxiosResponse): WebAPIHTTPError
) as Partial<WebAPIHTTPError>;
error.statusCode = response.status;
error.statusMessage = response.statusText;
error.headers = response.headers;
const nonNullHeaders: Record<string, string> = {};
Copy link
Member

Choose a reason for hiding this comment

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

good catch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TypeScript made me do it 😄

@filmaj filmaj requested a review from seratch October 4, 2023 16:12
* [Email us](mailto:developers@slack.com) in Slack developer support: `developers@slack.com`
* [Bot Developers Hangout](https://community.botkit.ai/): a Slack community for developers
building all types of bots. You can find the maintainers and users of these packages in **#sdk-node-slack-sdk**.
* [Email us](mailto:feedback@slack.com): `feedback@slack.com`
Copy link
Contributor

Choose a reason for hiding this comment

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

Should they email feedback@slack.com or support@slack.com? other repos tell developers to email support@slack.com

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is feedback@slack.com

@filmaj filmaj merged commit 6e8a31e into main Oct 5, 2023
15 checks passed
@filmaj filmaj deleted the web-api-major branch October 5, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:web-api applies to `@slack/web-api` semver:major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants