-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added db password in cassandra-integration-test #5644
Conversation
Signed-off-by: ayushrakesh <[email protected]>
@ayushrakesh do we really need to increase the number of arguments passed this will cause the ci to fail and I don't think we should add password in github action |
@hellspawn679 should I use env variable? |
And further passing database password through Github action secrets -> in cassandra CI? |
+1. There is no need to complicate the CI scripts with ability to override password, if it's needed in the future we can add it. It still should not be required argument to the script, but an optional one. |
@yurishkuro @hellspawn679 so what should be done, db password should be passed as an optional parameter then what is the default value? Is it should be directly declared locally in run_integration function? |
the docker command starting Cassandra may need to specify password. The same password should be hardcoded in the integration tests. We have two flavors of integration tests:
|
@yurishkuro like this in both cassandra main and archive in cmd/jaeger/config-cassandra.yaml ? And in plugin/storage/integration/cassandra_test.go |
As approach - yes. Exact syntax- you need to try. |
Signed-off-by: ayushrakesh <[email protected]>
@yurishkuro Need to review, I have added different passwords for cassandra main and archive in cmd/jaeger/cassandra-config.yaml. |
@@ -37,6 +37,7 @@ apply_schema() { | |||
--env CQLSH_PORT=9042 | |||
--env "TEMPLATE=/cassandra-schema/${schema_version}.cql.tmpl" | |||
--env "KEYSPACE=${keyspace}" | |||
--env "DB_PASSWORD=${DB_PASSWORD}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- why only password and not user name?
- we don't need any env variables, the pwd can be simply hardcoded here, since the db container is created just for this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro Then what is the password?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whatever, make up a string, e.g. testpwd
Signed-off-by: ayushrakesh <[email protected]>
.github/workflows/ci-cassandra.yml
Outdated
run: bash scripts/cassandra-integration-test.sh ${{ matrix.version.major }} ${{ matrix.version.schema }} ${{ matrix.jaeger-version }} | ||
env: | ||
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | ||
run: bash scripts/cassandra-integration-test.sh ${{ matrix.version.major }} ${{ matrix.version.schema }} ${{ matrix.jaeger-version }} $DB_PASSWORD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to pass pwd here, it can be hardcoded in the script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro PR is revised now.
Signed-off-by: ayushrakesh <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5644 +/- ##
==========================================
- Coverage 96.38% 95.94% -0.44%
==========================================
Files 329 329
Lines 16060 16060
==========================================
- Hits 15479 15409 -70
- Misses 404 482 +78
+ Partials 177 169 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@yurishkuro Please review my revised PR. |
@@ -34,13 +34,13 @@ jobs: | |||
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |||
with: | |||
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exclude this file from the PR, since it's not changing (git checkout main <file>
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide proof of successful testing with scripts/cassandra-integration-test.sh
script.
@@ -6,6 +6,8 @@ services: | |||
ports: | |||
- "9042:9042" | |||
- "9160:9160" | |||
environment: | |||
- DB_PASSWORD=${DB_PASSWORD} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about username?
@@ -6,6 +6,8 @@ services: | |||
ports: | |||
- "9042:9042" | |||
- "9160:9160" | |||
environment: | |||
- DB_PASSWORD=${DB_PASSWORD} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why DB_PASSWORD
? Do you have a link to the docs showing that it's a recognized var?
require.NotEmpty(t, password, "DB_PASSWORD environment variable must be set") | ||
|
||
// Add the Cassandra password flag | ||
flags = append(flags, "--cassandra.password="+password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already set in the next function, why is it here again?
no follow-up, closing |
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test