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

feat: Kubernetes changes #192

Merged
merged 8 commits into from
Mar 4, 2024
Merged

feat: Kubernetes changes #192

merged 8 commits into from
Mar 4, 2024

Conversation

okan-cakmak
Copy link
Contributor

Change description

Description here

Type of change

  • Bug fix (fixes an issue)
  • New feature (adds functionality)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • Application changes have been tested thoroughly
  • Automated tests covering modified code pass

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Code review

  • Pull request has a descriptive title and it follows conventional commit format and breaking change indicator if required (You can use the Angular convention)
  • Screenshots or screencasts are attached as necessary
  • "Ready for review" label attached and reviewers assigned
  • Changes have been reviewed by at least one other contributor
  • Pull request linked to task tracker where applicable

@okan-cakmak okan-cakmak requested review from yuqu and removed request for yuqu February 27, 2024 12:09
env:
GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

post-deploy:
Copy link
Member

Choose a reason for hiding this comment

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

As far as I see, this is similar to scim. Can you remind me why we need these in this file? I mean this could be a dev publish. (@yuqu)

Copy link
Contributor

@yuqu yuqu Feb 28, 2024

Choose a reason for hiding this comment

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

If this is a dev publish it will just create release markers on Newrelic and Sentry for dev environment, we won't see it for prod environment

Copy link
Member

Choose a reason for hiding this comment

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

Newrelic shows "related changes" as markers, I'd definitely not want to see it as a related change in its prod version, for example.

Also, the reason I was confused was because I forgot we'll get rid off development.yaml and production.yaml files. We should check if the new docker publish does everything in those files in other services, too (for example public-api does not put markets in the docker publish file).

@@ -48,12 +48,13 @@
"express": "^4.17.1",
"helmet": "7.0.0",
"http-status-codes": "^1.4.0",
"http-terminator": "^3.2.0",
"mixpanel": "^0.13.0",
"mongoose": "7.6.7",
"newrelic": "8.14.0",
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we upgrade newrelic? (and maybe axios?)

Copy link
Contributor Author

@okan-cakmak okan-cakmak Feb 29, 2024

Choose a reason for hiding this comment

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

upgrading newrelic throws this error. so I've skipped it to fix with the node 20 changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

axios updated.

Copy link
Member

Choose a reason for hiding this comment

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

OK 👍 We should not need it for Node 16 anyways.

@@ -28,6 +29,8 @@ interface SentryGetParams {
interface ErrorTracker {
captureError: (error: ServerError, extra: Extra) => void;
flush: () => Promise<void> ;
close: (timeout?: number) => Promise<boolean>;
SENTRY_CLOSE_TIMEOUT?: number;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is a generic setup. I suggest calling this as CLOSE_TIMEOUT .

const httpTerminator = createHttpTerminator({ server: this.server });
await httpTerminator.terminate();

delete this.server;
Copy link
Member

Choose a reason for hiding this comment

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

This is something we didn't have in other services. Why do need it and should we change the others accordingly?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is just a convenience operation, to not attempt to close the server if already done.

the existing codebase is improved in scim, ms-teams etc. to do such things in an elegant way. For example, server in zeplin-api is defined as let server; on file scope, we cannot use delete operator on such a variable, but we could set it to undefined. As I said, it is not mandatory but just a nice to have thing

Copy link
Member

Choose a reason for hiding this comment

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

Also, in some of the other services, we did initialized the httpTerminator on server.init. Does it have a difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

according to the source code, it makes difference. it keeps the list of open sockets while server is listening.

@@ -48,12 +48,13 @@
"express": "^4.17.1",
"helmet": "7.0.0",
"http-status-codes": "^1.4.0",
"http-terminator": "^3.2.0",
"mixpanel": "^0.13.0",
"mongoose": "7.6.7",
"newrelic": "8.14.0",
Copy link
Member

Choose a reason for hiding this comment

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

OK 👍 We should not need it for Node 16 anyways.

package.json Outdated
@@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"dev": "NODE_ENV=development nodemon",
"dev": "NODE_ENV=development NEW_RELIC_APP_NAME=msteams-local nodemon",
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is leftover?

@okan-cakmak okan-cakmak merged commit 097ef1d into main Mar 4, 2024
1 check passed
@okan-cakmak okan-cakmak deleted the kubernetes-changes branch March 4, 2024 06:27
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