Merge lp:~rharding/charmworld/novel-charmtools into lp:charmworld

Proposed by Richard Harding
Status: Merged
Approved by: Richard Harding
Approved revision: 450
Merged at revision: 450
Proposed branch: lp:~rharding/charmworld/novel-charmtools
Merge into: lp:charmworld
Diff against target: 88 lines (+15/-5)
5 files modified
charmworld/jobs/ingest.py (+6/-1)
charmworld/jobs/tests/test_ingest.py (+3/-3)
charmworld/testing/data/sample_charm/production_overrides.ini (+1/-0)
default.ini (+4/-0)
requirements.txt (+1/-1)
To merge this branch: bzr merge lp:~rharding/charmworld/novel-charmtools
Reviewer Review Type Date Requested Status
Juju Gui Bot continuous-integration Approve
Charmworld Developers Pending
Review via email: mp+194257@code.launchpad.net

Commit message

Use forked charm-tools to allow tweaking endpoint.

- The download-cache is updated with the forked build
- Tweaks to force ingest to look at localhost:port to run
- Added the port to the config and updated the production overrides so that
production talks to itself without egress filter issues.
- Update tests for the extra kwarg endpoint.

Note: You cannot ingest bundles without a running instance. This means
to ingest bundles in local dev you must also `make run`.

https://codereview.appspot.com/22540043/

R=bac

Description of the change

Use forked charm-tools to allow tweaking endpoint.

- The download-cache is updated with the forked build
- Tweaks to force ingest to look at localhost:port to run
- Added the port to the config and updated the production overrides so that
production talks to itself without egress filter issues.
- Update tests for the extra kwarg endpoint.

Note: You cannot ingest bundles without a running instance. This means
to ingest bundles in local dev you must also `make run`.

https://codereview.appspot.com/22540043/

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :
Download full text (4.2 KiB)

Reviewers: mp+194257_code.launchpad.net,

Message:
Please take a look.

Description:
Use forked charm-tools to allow tweaking endpoint.

- The download-cache is updated with the forked build
- Tweaks to force ingest to look at localhost:port to run
- Added the port to the config and updated the production overrides so
that
production talks to itself without egress filter issues.
- Update tests for the extra kwarg endpoint.

Note: You cannot ingest bundles without a running instance. This means
to ingest bundles in local dev you must also `make run`.

https://code.launchpad.net/~rharding/charmworld/novel-charmtools/+merge/194257

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/22540043/

Affected files (+17, -5 lines):
   A [revision details]
   M charmworld/jobs/ingest.py
   M charmworld/jobs/tests/test_ingest.py
   M charmworld/testing/data/sample_charm/production_overrides.ini
   M default.ini
   M requirements.txt

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20131106211543-mdy7zo9iywzec4mm
+New revision: <email address hidden>

Index: default.ini
=== modified file 'default.ini'
--- default.ini 2013-09-04 10:26:28 +0000
+++ default.ini 2013-11-06 22:54:45 +0000
@@ -58,6 +58,10 @@
  # text)
  days_of_revisions = 30

+# The port to hit up for proof. This should match up the server:main port
+# below.
+proof.port = 2464
+
  [server:main]
  use = egg:Paste#http
  host = 0.0.0.0

Index: requirements.txt
=== modified file 'requirements.txt'
--- requirements.txt 2013-11-05 00:24:42 +0000
+++ requirements.txt 2013-11-06 21:30:01 +0000
@@ -3,7 +3,7 @@
  Beaker==1.6.4
  bzr==2.5.1
  Chameleon==2.5.1
-charm-tools==1.1.2
+charm-tools==1.1.2-charmworld
  Cheetah==2.4.4
  colander==0.9.9
  configobj==4.7.2

Index: charmworld/jobs/ingest.py
=== modified file 'charmworld/jobs/ingest.py'
--- charmworld/jobs/ingest.py 2013-11-05 19:56:37 +0000
+++ charmworld/jobs/ingest.py 2013-11-06 22:54:45 +0000
@@ -347,7 +347,12 @@

      @staticmethod
      def proof(basket_file):
- lint, err = proof.proof(basket_file, is_bundle=True)
+ endpoint = "http://{}:{}/api/3/bundle/proof".format(
+ 'localhost',
+ settings['proof.port'],
+ )
+ lint, err = proof.proof(
+ basket_file, is_bundle=True, endpoint=endpoint)
          return lint, err >= CHARMTOOL_ERROR_CODE

      def run(self, basket_data):

Index: charmworld/jobs/tests/test_ingest.py
=== modified file 'charmworld/jobs/tests/test_ingest.py'
--- charmworld/jobs/tests/test_ingest.py 2013-11-05 18:57:10 +0000
+++ charmworld/jobs/tests/test_ingest.py 2013-11-06 23:04:32 +0000
@@ -608,7 +608,7 @@
          job = UpdateBundleJob()
          job.setup(self.db)
          with patch('charmtools.proof.proof',
- lambda path, is_bundle: ([], 200)):
+ lambda path, is_bundle, endpoint: ([], 200)):
              lint, err = job.proof('dummy')
              self.assertEqual(True, err)

@@ -616,...

Read more...

Revision history for this message
Brad Crittenden (bac) wrote :

LGTM, thanks

https://codereview.appspot.com/22540043/diff/1/charmworld/jobs/ingest.py
File charmworld/jobs/ingest.py (right):

https://codereview.appspot.com/22540043/diff/1/charmworld/jobs/ingest.py#newcode352
charmworld/jobs/ingest.py:352: settings['proof.port'],
Where does proof.port come from? I've looked but don't see it (which is
why I'm glad you did this part).

https://codereview.appspot.com/22540043/diff/1/charmworld/testing/data/sample_charm/production_overrides.ini
File charmworld/testing/data/sample_charm/production_overrides.ini
(right):

https://codereview.appspot.com/22540043/diff/1/charmworld/testing/data/sample_charm/production_overrides.ini#newcode8
charmworld/testing/data/sample_charm/production_overrides.ini:8:
proof.port = 6543
Oh, looky, there it is!

https://codereview.appspot.com/22540043/

Revision history for this message
Juju Gui Bot (juju-gui-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmworld/jobs/ingest.py'
--- charmworld/jobs/ingest.py 2013-11-05 19:56:37 +0000
+++ charmworld/jobs/ingest.py 2013-11-06 23:15:48 +0000
@@ -347,7 +347,12 @@
347347
348 @staticmethod348 @staticmethod
349 def proof(basket_file):349 def proof(basket_file):
350 lint, err = proof.proof(basket_file, is_bundle=True)350 endpoint = "http://{}:{}/api/3/bundle/proof".format(
351 'localhost',
352 settings['proof.port'],
353 )
354 lint, err = proof.proof(
355 basket_file, is_bundle=True, endpoint=endpoint)
351 return lint, err >= CHARMTOOL_ERROR_CODE356 return lint, err >= CHARMTOOL_ERROR_CODE
352357
353 def run(self, basket_data):358 def run(self, basket_data):
354359
=== modified file 'charmworld/jobs/tests/test_ingest.py'
--- charmworld/jobs/tests/test_ingest.py 2013-11-05 18:57:10 +0000
+++ charmworld/jobs/tests/test_ingest.py 2013-11-06 23:15:48 +0000
@@ -608,7 +608,7 @@
608 job = UpdateBundleJob()608 job = UpdateBundleJob()
609 job.setup(self.db)609 job.setup(self.db)
610 with patch('charmtools.proof.proof',610 with patch('charmtools.proof.proof',
611 lambda path, is_bundle: ([], 200)):611 lambda path, is_bundle, endpoint: ([], 200)):
612 lint, err = job.proof('dummy')612 lint, err = job.proof('dummy')
613 self.assertEqual(True, err)613 self.assertEqual(True, err)
614614
@@ -616,7 +616,7 @@
616 job = UpdateBundleJob()616 job = UpdateBundleJob()
617 job.setup(self.db)617 job.setup(self.db)
618 with patch('charmtools.proof.proof',618 with patch('charmtools.proof.proof',
619 lambda path, is_bundle: ([], 100)):619 lambda path, is_bundle, endpoint: ([], 100)):
620 lint, err = job.proof('dummy')620 lint, err = job.proof('dummy')
621 self.assertEqual(False, err)621 self.assertEqual(False, err)
622622
@@ -624,7 +624,7 @@
624 job = UpdateBundleJob()624 job = UpdateBundleJob()
625 job.setup(self.db)625 job.setup(self.db)
626 with patch('charmtools.proof.proof',626 with patch('charmtools.proof.proof',
627 lambda path, is_bundle: ([], 0)):627 lambda path, is_bundle, endpoint: ([], 0)):
628 lint, err = job.proof('dummy')628 lint, err = job.proof('dummy')
629 self.assertEqual(False, err)629 self.assertEqual(False, err)
630630
631631
=== modified file 'charmworld/testing/data/sample_charm/production_overrides.ini'
--- charmworld/testing/data/sample_charm/production_overrides.ini 2013-02-01 15:57:19 +0000
+++ charmworld/testing/data/sample_charm/production_overrides.ini 2013-11-06 23:15:48 +0000
@@ -5,6 +5,7 @@
5mongo.host =5mongo.host =
6mongo.port =6mongo.port =
7session.secret =7session.secret =
8proof.port = 6543
89
9[server:main]10[server:main]
10port = 654311port = 6543
1112
=== modified file 'default.ini'
--- default.ini 2013-09-04 10:26:28 +0000
+++ default.ini 2013-11-06 23:15:48 +0000
@@ -58,6 +58,10 @@
58# text)58# text)
59days_of_revisions = 3059days_of_revisions = 30
6060
61# The port to hit up for proof. This should match up the server:main port
62# below.
63proof.port = 2464
64
61[server:main]65[server:main]
62use = egg:Paste#http66use = egg:Paste#http
63host = 0.0.0.067host = 0.0.0.0
6468
=== modified file 'requirements.txt'
--- requirements.txt 2013-11-05 00:24:42 +0000
+++ requirements.txt 2013-11-06 23:15:48 +0000
@@ -3,7 +3,7 @@
3Beaker==1.6.43Beaker==1.6.4
4bzr==2.5.14bzr==2.5.1
5Chameleon==2.5.15Chameleon==2.5.1
6charm-tools==1.1.26charm-tools==1.1.2-charmworld
7Cheetah==2.4.47Cheetah==2.4.4
8colander==0.9.98colander==0.9.9
9configobj==4.7.29configobj==4.7.2

Subscribers

People subscribed via source and target branches

to all changes: