Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Strange issue with double dependency detection / writing package.json twice #55

Closed
Marak opened this Issue · 10 comments

5 participants

@Marak

It appears that the package.json write is sometimes triggered twice when deploying apps.

To reproduce:

  1. clone marak's hellonode application
  2. (you may have to deploy once before deleting the package.json)
  3. delete the package.json
  4. jitsu deploy
  5. read screen output ( package is written twice )
@bmeck bmeck was assigned
@bmeck

Can you get a screen dump of this, from what I'm seeing it is bumping the version number if it was already deployed to an unused one and only doing it once if it has not been deployed (or if it has been destroyed).

@bmeck

So the issue is that it is being written twice, but it is writing 2 different package.json files.

  1. Before asking the server if this is a deployable snapshot.
  2. After finding it is not and bumping the version number.

The problem with not writing twice is that if we don't write through on the first one and there is a connection error you will be prompted to save after an error (odd UX). If we don't prompt on the second we might end up w/ some UX issues from people saying it is not writing what it prompted it would. We could make version bumping not prompt the user and instead just write?

Also, adding a message about the version number being bumped a bit more explicitly.

@indexzero
Owner

This is an order-of-operations problem in the jitsu deploy command: https://github.com/nodejitsu/jitsu/blob/master/lib/jitsu/commands/apps.js#L99-127

Ideally the workflow should be:

  1. jitsu.package.read
  2. If no package.json, prompt for app name and then attempt jitsu.apps.view
  3. If application exists, write truncated results to disk and increment version number
  4. If no application exists (i.e. on 404 error), continue with the rest of jitsu.package.get.
  5. Otherwise, error out of the CLI because something bad has happened (i.e. 500)
@Marak

@bmeck - Will you be able to resolve this issue?

@bmeck
@bmeck bmeck referenced this issue from a commit
@bmeck bmeck [fix] #55 package.write after filling out package.json was forcing a …
…2nd analyze. Since no deps can be added during filling, don't do that.
30b329c
@AvianFlu

It looks like I'm still seeing this issue in Jitsu v0.4.0.

https://gist.github.com/1138356

@jfhbrook

I don't believe this is still an issue. Closing.

@jfhbrook jfhbrook closed this
@indexzero indexzero reopened this
@indexzero
Owner

I've seen this issue recently. I will give you a repro this weekend.

@indexzero indexzero closed this
@indexzero indexzero reopened this
@Marak

Am not about to reproduce / haven't seen this. Closing unless someone can post reproducible steps.

@Marak Marak closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.