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

Closed
Marak opened this Issue Jul 1, 2011 · 10 comments

Comments

Projects
None yet
5 participants
Contributor

Marak commented Jul 1, 2011

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 )

@ghost ghost assigned bmeck Jul 1, 2011

Contributor

bmeck commented Jul 5, 2011

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).

Contributor

bmeck commented Jul 7, 2011

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.

Owner

indexzero commented Jul 7, 2011

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)
Contributor

Marak commented Jul 11, 2011

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

Contributor

bmeck commented Jul 11, 2011

yes i can, but indexzero put it at a low priority so I stalled

On Mon, Jul 11, 2011 at 4:26 PM, Marak
reply@reply.github.com
wrote:

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

Reply to this email directly or view it on GitHub:
#55 (comment)

bmeck added a commit that referenced this issue Aug 9, 2011

[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.
Contributor

AvianFlu commented Aug 10, 2011

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

https://gist.github.com/1138356

Contributor

jfhbrook commented Nov 16, 2011

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

@jfhbrook jfhbrook closed this Nov 16, 2011

@indexzero indexzero reopened this Nov 17, 2011

Owner

indexzero commented Nov 17, 2011

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

@indexzero indexzero closed this Nov 17, 2011

@indexzero indexzero reopened this Nov 17, 2011

Contributor

Marak commented Mar 21, 2012

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

@Marak Marak closed this Mar 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment