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

Inconsistency with keyPrefix #59

Closed
pedrokost opened this issue May 21, 2016 · 4 comments
Closed

Inconsistency with keyPrefix #59

pedrokost opened this issue May 21, 2016 · 4 comments

Comments

@pedrokost
Copy link

My Redis config contains the following:

redis: {
    allowOverwrite: true,
    keyPrefix: 'zatresi',
    maxRecentUploads: 100
},

When I run ember deploy prod I get the following output:

- Deployed but did not activate revision eb65b18c84b6b6b373fa5315e6661a9b. To activate, run: ember deploy:activate prod --revision=eb65b18c84b6b6b373fa5315e6661a9b

In Redis, the key zatresi:eb65b18c84b6b6b373fa5315e6661a9b indeed contains the HTML content of the index.html file.

Next, I run:

ember deploy:activate prod --revision=eb65b18c84b6b6b373fa5315e6661a9b

This sets the value of they key zatresi:current to eb65b18c84b6b6b373fa5315e6661a9b instead of zatresi:eb65b18c84b6b6b373fa5315e6661a9b. I believe this is a regression from a much earlier version of the addon. At some point, the behavior changed.

The documentation says:

The unique revision number for the version of the file being uploaded to Redis. The Redis key will be a combination of the keyPrefix and the revisionKey. By default this option will use either the revisionKey passed in from the command line or the revisionData.revisionKey property from the deployment context.

Default: context.commandLineArgs.revisionKey || context.revisionData.revisionKey

I believe the default should instead be: keyPrefix + context.commandLineArgs.revisionKey || context.revisionData.revisionKey

Also, from this documentation it is not clear how I can override the revisionKey parameter. Can I pass a function which accepts the keyPrefix and/or context to it?

@achambers
Copy link
Member

achambers commented May 21, 2016

Hi @pedrokost.

The functionality that you are describing is quite intentional.

It is by design that <keyPrefix>:current points to the Revision Key and not the Redis Key.

This plugin will combine the keyPrefix property and the revisionKey property to determine the Redis Key. Therefore it doesn't make sense for the revisionKey property to either accept the keyPrefix or return a value containing it. The revisionKey is supposed to be the unique value that identifies the revision.

Hope this cleared things up a bit. I'm going to close this issue as there is nothing to be changed here.

If you have any other questions or need something clarified more, by all means ask them here, or reopen this if you need to.

@pedrokost
Copy link
Author

@achambers OK

Why wouldn't the revisionKey and the Redis Key be the same? Wouldn't this remove one possible source of confusion?

@achambers
Copy link
Member

@pedrokost What confusion is that?

@pedrokost
Copy link
Author

pedrokost commented May 21, 2016

@achambers Nevermind. I only stumbled upon this because I was upgrading from ember-deploy-redis#0.0.7 to ember-cli-deploy-redis.

~~In the former prefixKey:current points to the actual HTML, but in the latter it points to a reference key. Instead the content is in prefixKey:current-content by default. ~~

I can work around this without changing the server side code by renaming activationSuffix to current-pointer and activeContentSuffix to current.

Edit: I wrote incorrectly. In ember-deploy-redis#0.0.7 prefixKey:current contained prefixKey:reference. The only way I can work around this difference seems to by changing the server code.

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

No branches or pull requests

2 participants