Closed Bug 613587 Opened 14 years ago Closed 12 years ago

cfx init should generate a JID

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: KWierso)

References

Details

Attachments

(1 file, 3 obsolete files)

"cfx init" creates most of the necessary infrastructure for an addon, but it doesn't generate a public/private key pair, which then has to get generated the first time the user runs "cfx run" (causing "cfx run" not to do what the user expects the first time they run it).

"cfx init" should generate that public/private key pair automatically as part of its process of setting up the infrastructure for an addon.
Could i implement it?, it's a good idea
Julián: sure, that'd be great!  Assigning the bug to you.
Assignee: nobody → cristianjulianceballos
this is the update of "cfx init", i've made in git:
$ git add packages/init-template/*
$ git rm python-lib/cuddlefish/templates.py

but the patch doesn't show me the files added and deleted, how could i do it?, because in this code i use the template in the folder packages/init-template, i've wrote my reasons for this, in bug 613630 -> https://bugzilla.mozilla.org/show_bug.cgi?id=613630
Attachment #493500 - Flags: review?(warner-bugzilla)
Are you familiar with the git "staging area", also known (unfortunately) as the "cache" or the "index"? The "git add" command copies changes into the staging area, and "git diff" only shows you the differences between the staging area and your working tree. Use "git diff --cached" to see the differences between the latest checkout and the staging area.

Does the generate-keypair fix depend upon the move-template-into-a-package fix? Should I be looking at the attachment now, or waiting for a version of the patch with additional files?
To generare the keypair you need first the addon template in examples directory where it will be. I'll upload a new version of the patch with this bugs fixed.
Hi everybody, i've finished the code for cfx init new functions to generate the public and private key :). Everything it's ok, well i guess.

The rest of the patch is in the bug 613604, the content in that patch is the new files for generate the init template for addons.
Attachment #493500 - Attachment is obsolete: true
Attachment #494302 - Flags: review?(warner-bugzilla)
Attachment #493500 - Flags: review?(warner-bugzilla)
Comment on attachment 494302 [details] [diff] [review]
init generate a private/public keypair

As mentioned on Bug 613604, could you make this into a self-contained patch? Making it build on top of the patch from 613604 is fine (and we can make this bug depend upon that one). As it stands, I can't apply it independently.

The patch seems about right, but I'll wait until I can apply and test it. One thing to consider is that copying each file separately is a bit of a drag: you might want to use shutil.copytree() and copy everything from the template directory into the target.
Attachment #494302 - Flags: review?(warner-bugzilla) → review-
Priority: -- → P3
Target Milestone: --- → 1.0
Note that I implemented this in one of the patches in bug 641215 (commit 'a3f8915' here: https://github.com/mozilla/addon-sdk/pull/124 )
Now that we've removed the cryptographic keys (Bug 654588), this ticket can be converted into one about generating random JIDs during 'cfx init', which is marginally easier.
Summary: cfx init should generate a public/private key pair → cfx init should generate a JID
(automatic reprioritization of 1.0 bugs)
Priority: P3 → P2
Target Milestone: 1.0 → 1.1
(Pushing all open bugs to the --- milestone for the new triage system)
Target Milestone: 1.1 → ---
Attached file Link to pull request 461 (obsolete) —
I'm sure there's more that needs to be cleaned up in addition to this, but this patch seems to work for me.

It copies preflight.py's method of generating the jID over to __init__.py, allowing cfx init to generate the jID as part of what it does. 

With this patch, I no longer need to do 'cfx run' twice to actually get the addon running.
Attachment #494302 - Attachment is obsolete: true
Comment on attachment 631520 [details]
Link to pull request 461

Alex, can you take a look at this?
Attachment #631520 - Flags: review?(poirot.alex)
Assignee: cristianjulianceballos → kwierso
Comment on attachment 631520 [details]
Link to pull request 461

Made a comment in pull request. Tests are failing and need to be fixed.
Attachment #631520 - Flags: review?(poirot.alex)
I screwed up the branch I was working on this in, so had to move it to another branch/pull request.

I think I addressed most of your issues with it.
Attachment #631520 - Attachment is obsolete: true
Attachment #659853 - Flags: review?(poirot.alex)
Comment on attachment 659853 [details]
Link to pull request 564

Looks good. Tests pass. Tested manually and works fine.
For some reason your branch has conflict with master so that we can't merge it automatically.
Attachment #659853 - Flags: review?(poirot.alex) → review+
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/61c5fca000c794138942604fcd48db53bcedcf93
Merge pull request #703 from KWierso/613587final

Bug 613587 - Make cfx init automatically generate the jID
I had to make a new pull request to get this mergeable, but it's essentially the same code.

Pull request here: https://github.com/mozilla/addon-sdk/pull/703

Carrying the r+ forward and landed it.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Commit pushed to integration at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/61c5fca000c794138942604fcd48db53bcedcf93
Merge pull request #703 from KWierso/613587final
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: