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

test_python_model.py::TestSecrets::test_secrets is failing in some scenarios #1096

Merged
merged 8 commits into from
Jun 28, 2024

Conversation

McKnight-42
Copy link
Contributor

@McKnight-42 McKnight-42 commented Jun 26, 2024

resolves #1003
docs dbt-labs/docs.getdbt.com/#

Problem

in ci/cd test is failing for

Database Error in model secret_python_model (models/secret_python_model.py) 509007 (22023): SQL compilation error: Integrations do not allow secret '***.TEST17142092113402529018_TEST_PYTHON_MODEL.TEST_SECRET'. compiled Code at target/run/test/models/secret_python_model.py

This appears to be caused by our ci/cd running multiple instances of tests across various versions of python and os types.

Solution

adding a uuid suffix to the end of each required variable for the secrets should stop collision between version running at same test as each instance should have its own uuid

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@McKnight-42 McKnight-42 self-assigned this Jun 26, 2024
@McKnight-42 McKnight-42 requested a review from a team as a code owner June 26, 2024 21:35
@cla-bot cla-bot bot added the cla:yes label Jun 26, 2024
@McKnight-42 McKnight-42 added the Skip Changelog Skips GHA to check for changelog file label Jun 26, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-snowflake contributing guide.

@McKnight-42
Copy link
Contributor Author

McKnight-42 commented Jun 27, 2024

ci run on this branch to track multiple runs see if test fails: https://github.com/dbt-labs/dbt-snowflake/actions/runs/9715531000

)
project.run_sql(
"create or replace external access integration test_external_access_integration allowed_network_rules = (test_network_rule) allowed_authentication_secrets = (test_secret) enabled = true;"
f"create or replace external access integration {test_external_access_integration} allowed_network_rules = ({test_network_rule}) allowed_authentication_secrets = (test_secret) enabled = true;"
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we missed an instance of test_secret.

@McKnight-42 McKnight-42 requested a review from mikealfare June 28, 2024 14:43
@McKnight-42 McKnight-42 merged commit 220f087 into main Jun 28, 2024
26 checks passed
@McKnight-42 McKnight-42 deleted the mcknight/1003 branch June 28, 2024 17:32
Copy link
Contributor

The backport to 1.8.latest failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.8.latest 1.8.latest
# Navigate to the new working tree
cd .worktrees/backport-1.8.latest
# Create a new branch
git switch --create backport-1096-to-1.8.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 220f08724a5b8d4d2e3bd461b15af3346f168c88
# Push it to GitHub
git push --set-upstream origin backport-1096-to-1.8.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.8.latest

Then, create a pull request where the base branch is 1.8.latest and the compare/head branch is backport-1096-to-1.8.latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.8.latest cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] test_python_model.py::TestSecrets::test_secrets is failing in some scenarios
3 participants