You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the arn is defined, it creates the Proxy object which is what we want for the controller. The problem is that getConfig doesn't get the arn that was set by parseArgs. So even if I use --arn it will skip the logic for creating the Proxy. If I put an empty arn property in the migrate.json5 file, it will create a Proxy, but it passes the empty string to the constructor which overrides this.arn: https://github.com/sensedeep/onetable-cli/blob/main/src/cli.js#L551
So the problem seems to be that --arn does not get evaluated along side the arn property. I'm not sure if it gets used outside of being set in the args. I didn't have the time look thoroughly, but it's possible that many of the args aren't being blended with config values.
To Reproduce
Steps to reproduce the behavior:
Include your OneTable schema: Schema does not matter for bug
Include actual onetable command used and output generated: ../../node_modules/.bin/onetable --debug --force --config ./migrate.json5 --arn $FUNCTION_ARN --table $TABLE_NAME "up"
Run command with --debug and include additional trace: Cannot communicate with DynamoDB "<table-name>" at "placeholder"
Expected behavior
I expected that any command line arguments would would be blended with migrate.json5 properties that were not supplied. Instead, CLI.init() only evaluates the json properties when determining whether to use Proxy.
Environment (please complete the following information):
OS: Mac Ventura
Node Version: 20
Additional context
What I'm trying to accomplish:
I am trying to run onetable-migrate in a CI/CD environment. I can pull the current version using onetable status and the desired version using version in my schema file. I can use that to determine whether this is a migration up or down.
I also get the arn of my controller via aws cli and the table name is calculated after deployment based on stage names. So I can not have my infrastructure configurations in the json5 file. I tried using the various command line options like --arn, and --table.
In the meantime, I might have to create the migrate.json5 file at runtime to workaround this behavior, unless you have some other suggestions.
The text was updated successfully, but these errors were encountered:
Describe the bug
After looking into the source code, I found the following:
arn gets set here: https://github.com/sensedeep/onetable-cli/blob/main/src/cli.js#L431
config is pulled in here: https://github.com/sensedeep/onetable-cli/blob/main/src/cli.js#L111
arn is checked here: https://github.com/sensedeep/onetable-cli/blob/main/src/cli.js#L134
If the arn is defined, it creates the Proxy object which is what we want for the controller. The problem is that
getConfig
doesn't get the arn that was set byparseArgs
. So even if I use--arn
it will skip the logic for creating the Proxy. If I put an emptyarn
property in the migrate.json5 file, it will create a Proxy, but it passes the empty string to the constructor which overridesthis.arn
: https://github.com/sensedeep/onetable-cli/blob/main/src/cli.js#L551So the problem seems to be that
--arn
does not get evaluated along side thearn
property. I'm not sure if it gets used outside of being set in the args. I didn't have the time look thoroughly, but it's possible that many of the args aren't being blended with config values.To Reproduce
Steps to reproduce the behavior:
../../node_modules/.bin/onetable --debug --force --config ./migrate.json5 --arn $FUNCTION_ARN --table $TABLE_NAME "up"
Cannot communicate with DynamoDB "<table-name>" at "placeholder"
Expected behavior
I expected that any command line arguments would would be blended with
migrate.json5
properties that were not supplied. Instead,CLI.init()
only evaluates the json properties when determining whether to useProxy
.Environment (please complete the following information):
Additional context
What I'm trying to accomplish:
I am trying to run onetable-migrate in a CI/CD environment. I can pull the current version using
onetable status
and the desired version usingversion
in my schema file. I can use that to determine whether this is a migration up or down.I also get the arn of my controller via aws cli and the table name is calculated after deployment based on stage names. So I can not have my infrastructure configurations in the json5 file. I tried using the various command line options like
--arn
, and--table
.In the meantime, I might have to create the
migrate.json5
file at runtime to workaround this behavior, unless you have some other suggestions.The text was updated successfully, but these errors were encountered: