Closed Bug 1287593 Opened 8 years ago Closed 8 years ago

add create-db command to run.sh

Categories

(Release Engineering Graveyard :: Applications: Balrog (backend), defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: nhuang, Mentored)

References

Details

(Whiteboard: [lang=python])

Attachments

(1 file)

We rebuilt stage this morning, and it would've been very helpful to have a target in run.sh that creates a db and optionally populates it with some data. Having this would avoid the need to override the entrypoint.
Assignee: bhearsum → nobody
Mentor: bhearsum
Whiteboard: [lang=python][good first bug]
I would like to work on this bug.I am very new to open source(this is my very first bug) so can you guide me how to go about it.
(In reply to harsh shah from comment #1)
> I would like to work on this bug.I am very new to open source(this is my
> very first bug) so can you guide me how to go about it.

Hi Harsh, thanks for your interest here! The first thing you'll want to do is fork the Balrog repo (https://github.com/mozilla/balrog), clone it locally, and make sure you can run all the tests succesfully. Once you have your local repo, try running "run-test.sh" and make sure it passes.

If you have any trouble getting set-up feel free to e-mail me, or ask in irc://irc.mozilla.org/#balrog.
I would like to work on this bug, I've cloned the balrog repo, and the tests passed, what next has to be done? First-timer at bug fixing and also first-timer at mozilla.
Flags: needinfo?(bhearsum)
(In reply to meet123mangukiya from comment #3)
> I would like to work on this bug, I've cloned the balrog repo, and the tests
> passed, what next has to be done? First-timer at bug fixing and also
> first-timer at mozilla.

I'd like to give Harsh a few more days to respon before reassigning this. If you'd like to look at something in the meantime, https://bugzilla.mozilla.org/show_bug.cgi?id=1281459 or https://bugzilla.mozilla.org/show_bug.cgi?id=1270827 would be good choices.
Flags: needinfo?(bhearsum)
I'd like to work on this bug. I am decent at shell scripting and I'm ready to learn. :)

Any pointers?
(In reply to deep.red.rosie.999 from comment #5)
> I'd like to work on this bug. I am decent at shell scripting and I'm ready
> to learn. :)
> 
> Any pointers?

https://github.com/mozilla/balrog/blob/master/uwsgi/run.sh is the file referenced by the bug title. What we need is a section similar to "upgrade-db" that initializes an empty db instead. This will probably be a matter of calling out to https://github.com/mozilla/balrog/blob/master/scripts/manage-db.py, which already knows how to create the database.

This is a bit trickier to test than some things. First of all, you'll need a virtualenv with Balrog installed, eg:
git clone https://github.com/mozilla/balrog
cd balrog
virtualenv -p /usr/bin/python2.7 venv
source venv/bin/activate
python setup.py develop

When this is fixed correctly, we should be able to run commands such as:
DBURI=sqlite:///tmp/foo.db bash uwsgi/run.sh upgrade-db

...and end up with a fully initialized database in /tmp/foo.db.

--

I know this may be a lot to take in, so feel free to e-mail me or ask in irc://irc.mozilla.org/#balrog if you have any questions.
Assignee: nobody → deep.red.rosie.999
Did you make an progress?
Flags: needinfo?(deep.red.rosie.999)
(In reply to Ben Hearsum (:bhearsum) from comment #7)
> Did you make an progress?

It looks like you're not working on this. I'm going to unassign it for now. Please let me know if you still want to give it a try.
Flags: needinfo?(deep.red.rosie.999)
Whiteboard: [lang=python][good first bug] → [lang=python]
Assignee: deep.red.rosie.999 → nobody
Is this still open?
Hi, I created a patch to add create-db to run.sh. Tested out with `DBURI=sqlite:///foo.db bash scripts/run.sh create-db` and verified that foo.db is created, and checked that run-tests.sh passes for all tests
Attachment #8812093 - Flags: review?(bhearsum)
(In reply to nhuang from comment #10)
> Created attachment 8812093 [details] [diff] [review]
> Patch to add create-db in run.sh
> 
> Hi, I created a patch to add create-db to run.sh. Tested out with
> `DBURI=sqlite:///foo.db bash scripts/run.sh create-db` and verified that
> foo.db is created, and checked that run-tests.sh passes for all tests

This looks good - if you have a Github account, could you send it as a Pull Request to https://github.com/mozilla/balrog?
Assignee: nobody → nhuang
Flags: needinfo?(nhuang)
Attachment #8812093 - Flags: review?(bhearsum) → review+
(In reply to Ben Hearsum (:bhearsum) from comment #11)
> (In reply to nhuang from comment #10)
> > Created attachment 8812093 [details] [diff] [review]
> > Patch to add create-db in run.sh
> > 
> > Hi, I created a patch to add create-db to run.sh. Tested out with
> > `DBURI=sqlite:///foo.db bash scripts/run.sh create-db` and verified that
> > foo.db is created, and checked that run-tests.sh passes for all tests
> 
> This looks good - if you have a Github account, could you send it as a Pull
> Request to https://github.com/mozilla/balrog?

Sure, will do this tonight
(In reply to nhuang from comment #12)
> (In reply to Ben Hearsum (:bhearsum) from comment #11)
> > (In reply to nhuang from comment #10)
> > > Created attachment 8812093 [details] [diff] [review]
> > > Patch to add create-db in run.sh
> > > 
> > > Hi, I created a patch to add create-db to run.sh. Tested out with
> > > `DBURI=sqlite:///foo.db bash scripts/run.sh create-db` and verified that
> > > foo.db is created, and checked that run-tests.sh passes for all tests
> > 
> > This looks good - if you have a Github account, could you send it as a Pull
> > Request to https://github.com/mozilla/balrog?
> 
> Sure, will do this tonight

Pull request sent
Flags: needinfo?(nhuang)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Normally we wait until things are in production to close the bugs, but this is fine :) - just correcting the resolution.
Resolution: WORKSFORME → FIXED
(In reply to Ben Hearsum (:bhearsum) from comment #15)
> Normally we wait until things are in production to close the bugs, but this
> is fine :) - just correcting the resolution.

Oh oops thought it was in prod sorry :(
Depends on: 1320966
This change will be deployed in bug 1320966 sometime between 11am and 1pm pacific on 2016-11-30. IT will be deployed to stage today. Can you verify your fixes once stage is deployed please?
Flags: needinfo?(nhuang)
There's nothing here that can be verified in stage.
Flags: needinfo?(nhuang)
Product: Release Engineering → Release Engineering Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: