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

Addressing the following Redis related issues. #172

Merged
merged 8 commits into from
Feb 3, 2023

Conversation

ehardy
Copy link
Contributor

@ehardy ehardy commented Nov 11, 2022

Problem

Redis seems to have become mandatory in recent releases. We have noticed a couple of issues after grabbing the latest version.

  1. Failure to initialize the RedisTransport object in src/logger.ts in cases where Redis requires password authentication (which is the case in our environments).
  2. It did not seem like Redis was getting initialized for the persisted query feature. It appeared that way as we were noticing Redis related warnings in the logs when exercising the persisted query feature.
  3. Streaming registry logs over Redis should be an opt in feature in our opinions, so simply checking if a Redis host is configured before enabling the feature is not enough.

Changes

  • Passing the Redis password to the RedisTransport constructor in src/logger.ts.
  • Initializing Redis in the init() function in src/index.ts. With this change the warnings in the logs disappear.
  • In order to cover the Redis/password cases, the docker-compose.base.yml now makes sure to launch Redis with password protection.
  • Adding an environment variable called LOG_STREAMING_ENABLED to further control if log streaming over Redis should be enabled or not.

Testing

All existing unit and integration tests are passing.

@ehardy ehardy requested a review from a team November 11, 2022 20:24
@pipedrive-bot-eventsink

Main branch dependencies

snyk vulnerabilities

@ehardy
Copy link
Contributor Author

ehardy commented Nov 16, 2022

Will have a look at the failing checks

@ehardy
Copy link
Contributor Author

ehardy commented Nov 26, 2022

@tot-ra All checks are now green. Could you have a look at the PR?

README.md Outdated
| KAFKA_QUERIES_TOPIC | Topic with new schema | graphql-queries |
| LOG_LEVEL | Minimum level of logs to output | info |
| LOG_TYPE | Output log type, supports pretty or json. | pretty |
| LOG_STREAMING_ENABLED | Controls whether logs are streamed over Redis to be presented in UI | false |
Copy link
Owner

Choose a reason for hiding this comment

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

I'd suggest to enable it by default to have richest experience by default

Copy link
Owner

Choose a reason for hiding this comment

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

Or what do you think.. should we move to most minimal version by default (no redis, no kafka.. maybe even no mysql -> sqlite?)

Copy link
Contributor Author

@ehardy ehardy Nov 26, 2022

Choose a reason for hiding this comment

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

I'd suggest to enable it by default to have richest experience by default

Sounds reasonable to me. As long as there's a configuration to disable it, I don't mind having to disable it within our deployments. I'll invert the logic.

@tot-ra
Copy link
Owner

tot-ra commented Nov 26, 2022

also noticed that by default if there are no logs, then UI doesn't handle it well.. If you can handle that, great. If not, I can fix in follow-up

Screenshot 2022-11-26 at 21 01 55

@ehardy
Copy link
Contributor Author

ehardy commented Nov 26, 2022

also noticed that by default if there are no logs, then UI doesn't handle it well.. If you can handle that, great. If not, I can fix in follow-up

We had implemented this logic within our fork and it seemed to work well. I'll check it out.

@ehardy
Copy link
Contributor Author

ehardy commented Nov 28, 2022

@tot-ra Everything should be good now. Streaming logs over Redis is enabled by default. Could you have another look?

@tot-ra
Copy link
Owner

tot-ra commented Dec 2, 2022

hmm.. I keep getting

graphql-schema-registry-gql-schema-registry-1            | [2022-12-02T02:21:07.194Z] error: Redis error NOAUTH Authentication required. ReplyError: NOAUTH Authentication required.
graphql-schema-registry-gql-schema-registry-1            |     at Object.onceWrapper (node:events:627:28)
graphql-schema-registry-gql-schema-registry-1            |     at Socket.emit (node:events:525:35)

when I run docker-compose -f docker-compose.base.yml -f docker-compose.dev.yml up

@ehardy
Copy link
Contributor Author

ehardy commented Dec 2, 2022

@tot-ra Fixed the docker-compose.dev.yml configs. I never use this docker compose file, my bad. Should the docker-compose.prod.yml file be adjusted too?

@ehardy
Copy link
Contributor Author

ehardy commented Dec 16, 2022

Hey @tot-ra , would you be able to take another look at this?

@tot-ra
Copy link
Owner

tot-ra commented Dec 18, 2022

@ehardy hey. Unfortunately I don't have access to pipedrive namespace anymore. I'm waiting for Pipedrive legal, devops tooling, core services team and CTO to handover repo to my personal namespace. If that doesn't happen until end of this year, I guess I'll fork it and continue work separately from this namespace

@rdepping
Copy link
Contributor

@ehardy hey. Unfortunately I don't have access to pipedrive namespace anymore. I'm waiting for Pipedrive legal, devops tooling, core services team and CTO to handover repo to my personal namespace. If that doesn't happen until end of this year, I guess I'll fork it and continue work separately from this namespace

@tot-ra Do you have any update on the future direction and support for the pipedrive schema registry?

@tot-ra
Copy link
Owner

tot-ra commented Jan 17, 2023

@rdepping I've forked the repo to my namespace - https://github.com/tot-ra/graphql-schema-registry hopefully I can maintain it instead

@tot-ra tot-ra merged commit fb6db9f into tot-ra:master Feb 3, 2023
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.

4 participants