Skip to content

Conversation

@yito88
Copy link
Member

@yito88 yito88 commented Nov 9, 2025

Description

To switch DB type for ScalarDB Cluster test

We will be able to easily add other DBs for the ScalarDB Cluster test.

Related issues and/or PRs

If this PR addresses or references any issues and/or other PRs, list them here.

Changes made

  • Use environment variables for Docker login
  • --db specifies the DB instead of cluster
    • Cluster test can be set by the profile with-profile cluster

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

Provide any additional information or notes that may be relevant to the reviewers or stakeholders.

@yito88 yito88 changed the title Switch DB in ScalarDB Cluster Switch DB for ScalarDB Cluster test Nov 16, 2025
@yito88 yito88 changed the title Switch DB for ScalarDB Cluster test Enable to Switch a DB in ScalarDB Cluster test Nov 16, 2025
@feeblefakie
Copy link
Contributor

@yito88 Is it ready for review?

@yito88 yito88 marked this pull request as ready for review November 26, 2025 09:32
Copilot AI review requested due to automatic review settings November 26, 2025 09:32
@yito88
Copy link
Member Author

yito88 commented Nov 26, 2025

@feeblefakie Ah, sorry, I forgot to change the status to open. It's ready.

Copilot finished reviewing on behalf of yito88 November 26, 2025 09:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the ScalarDB Cluster test configuration to improve flexibility and maintainability. Instead of using a special cluster value for the --db parameter, the PR introduces a cleaner separation where --db specifies the actual database type (e.g., postgres, cassandra) and cluster mode is enabled via the Leiningen profile with-profile cluster. Docker credentials are now passed via environment variables rather than command-line arguments.

Key Changes

  • Refactored --db parameter to specify the database type rather than the cluster/non-cluster mode
  • Cluster mode is now controlled by the cluster? environment variable set by the Leiningen profile
  • Docker credentials moved from command-line arguments to environment variables (DOCKER_USERNAME, DOCKER_ACCESS_TOKEN)

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scalardb/src/scalardb/runner.clj Removed "cluster" from supported DBs map, removed docker credential CLI options, updated module loading to check cluster? env var, added db-type parameter to gen-db calls
scalardb/src/scalardb/db_extend.clj Removed unused get-db-type method from DbExtension protocol
scalardb/src/scalardb/db/postgres.clj Updated gen-db signature to accept optional db-type parameter using variadic args
scalardb/src/scalardb/db/cluster.clj Refactored to accept db-type parameter throughout, moved docker credentials to environment variables, improved error handling in wipe! function, added db-type to ExtCluster record
scalardb/src/scalardb/db/cassandra.clj Updated gen-db signature to accept optional db-type parameter using variadic args
scalardb/project.clj Added cluster? environment variable to cluster profile configuration
README.md Updated example command to use environment variables for docker credentials instead of CLI arguments, changed --db cluster to --db postgres
.github/workflows/test.yml Updated workflow to set docker credentials as environment variables and use --db postgres instead of --db cluster
.github/workflows/daily.yml Updated workflow to set docker credentials as environment variables and use --db postgres instead of --db cluster
.github/workflows/cluster-test.yml Updated workflow to use --db postgres instead of --db cluster

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brfrn169
Copy link
Contributor

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the ScalarDB Cluster test to allow switching the backend database, which is a great enhancement for test flexibility. The changes are logical, moving Docker credentials to environment variables and using a profile to enable cluster testing. My review includes suggestions to improve maintainability by reducing code duplication and to enhance robustness by adding checks for necessary environment variables.

@brfrn169 brfrn169 requested a review from feeblefakie December 4, 2025 00:37
Copy link
Contributor

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie feeblefakie merged commit fd203d3 into master Dec 5, 2025
4 checks passed
@feeblefakie feeblefakie deleted the more-dbs branch December 5, 2025 00:32
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