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: add feature flag to clickhouse migration #6444

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ANU7MADHAV
Copy link

@ANU7MADHAV ANU7MADHAV commented Nov 14, 2024

Summary

The issue was that ClickHouse migrations were starting automatically when the server launched. To address this, I implemented a flag feature for conditional migrations. An environment variable, CLICKHOUSE_MIGRATION_ENABLED, was introduced with a default value of false. When set to false, migrations do not run; if changed to true, migrations will execute. This allows for an optimized, dynamic approach to managing migrations.

Related Issues / PR's

resolves #5678

Screenshots

NA

Affected Areas and Manually Tested Areas


Important

Adds a feature flag to conditionally execute ClickHouse migrations based on an environment variable.

  • Behavior:
    • Introduces CLICKHOUSE_MIGRATION_ENABLED environment variable to control ClickHouse migrations.
    • If false (default), migrations are skipped; if true, migrations are executed.
  • Functions:
    • Adds IsClickhouseMigrationEnable() in constants.go to check the environment variable.
    • Updates ClickHouseMigrate() in migrate.go to accept a config parameter and conditionally execute migrations.
  • Server Initialization:
    • Modifies NewServer() in server.go in both ee/query-service/app and pkg/query-service/app to use the new feature flag for migrations.

This description was created by Ellipsis for aae2372. It will automatically update as commits are pushed.

Copy link

welcome bot commented Nov 14, 2024

Welcome to the SigNoz community! Thank you for your first pull request and making this project better. 🤗

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ prashant-shahi
❌ ANU7MADHAV
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to aae2372 in 56 seconds

More details
  • Looked at 76 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. ee/query-service/app/server.go:198
  • Draft comment:
    The function name IsClickhouseMigrationEnable should be IsClickhouseMigrationEnabled for consistency and clarity.
  • Reason this comment was not posted:
    Marked as duplicate.
2. pkg/query-service/constants/constants.go:153
  • Draft comment:
    The function name should be IsClickhouseMigrationEnabled for consistency with naming conventions.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function IsClickhouseMigrationEnable is correctly placed in the constants file, as it deals with environment variables and configuration constants. However, the function name should be IsClickhouseMigrationEnabled to maintain consistency with the naming convention used in the rest of the codebase.
3. pkg/query-service/app/server.go:168
  • Draft comment:
    The feature flag for ClickHouse migrations is correctly implemented, resolving the issue described in the PR.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The PR correctly implements the feature flag for ClickHouse migrations, ensuring that migrations only run when the environment variable is set to true. This resolves the issue described in the PR.

Workflow ID: wflow_ZVMZ6TrViQkrXuAR


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

pkg/query-service/constants/constants.go Outdated Show resolved Hide resolved
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@prashant-shahi prashant-shahi changed the base branch from develop to main December 19, 2024 12:08
@prashant-shahi prashant-shahi requested review from srikanthccv, nityanandagohain and a team and removed request for srikanthccv and nityanandagohain December 19, 2024 12:08
@eKuG
Copy link
Contributor

eKuG commented Dec 19, 2024

LGTM, you can ask @srikanthccv for a review as well

@eKuG eKuG self-requested a review December 19, 2024 13:03
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.

Move QS migrations behind a flag.
4 participants