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
1=== modified file 'charmworld/jobs/ingest.py'
2--- charmworld/jobs/ingest.py 2013-11-05 19:56:37 +0000
3+++ charmworld/jobs/ingest.py 2013-11-06 23:15:48 +0000
4@@ -347,7 +347,12 @@
5
6 @staticmethod
7 def proof(basket_file):
8- lint, err = proof.proof(basket_file, is_bundle=True)
9+ endpoint = "http://{}:{}/api/3/bundle/proof".format(
10+ 'localhost',
11+ settings['proof.port'],
12+ )
13+ lint, err = proof.proof(
14+ basket_file, is_bundle=True, endpoint=endpoint)
15 return lint, err >= CHARMTOOL_ERROR_CODE
16
17 def run(self, basket_data):
18
19=== modified file 'charmworld/jobs/tests/test_ingest.py'
20--- charmworld/jobs/tests/test_ingest.py 2013-11-05 18:57:10 +0000
21+++ charmworld/jobs/tests/test_ingest.py 2013-11-06 23:15:48 +0000
22@@ -608,7 +608,7 @@
23 job = UpdateBundleJob()
24 job.setup(self.db)
25 with patch('charmtools.proof.proof',
26- lambda path, is_bundle: ([], 200)):
27+ lambda path, is_bundle, endpoint: ([], 200)):
28 lint, err = job.proof('dummy')
29 self.assertEqual(True, err)
30
31@@ -616,7 +616,7 @@
32 job = UpdateBundleJob()
33 job.setup(self.db)
34 with patch('charmtools.proof.proof',
35- lambda path, is_bundle: ([], 100)):
36+ lambda path, is_bundle, endpoint: ([], 100)):
37 lint, err = job.proof('dummy')
38 self.assertEqual(False, err)
39
40@@ -624,7 +624,7 @@
41 job = UpdateBundleJob()
42 job.setup(self.db)
43 with patch('charmtools.proof.proof',
44- lambda path, is_bundle: ([], 0)):
45+ lambda path, is_bundle, endpoint: ([], 0)):
46 lint, err = job.proof('dummy')
47 self.assertEqual(False, err)
48
49
50=== modified file 'charmworld/testing/data/sample_charm/production_overrides.ini'
51--- charmworld/testing/data/sample_charm/production_overrides.ini 2013-02-01 15:57:19 +0000
52+++ charmworld/testing/data/sample_charm/production_overrides.ini 2013-11-06 23:15:48 +0000
53@@ -5,6 +5,7 @@
54 mongo.host =
55 mongo.port =
56 session.secret =
57+proof.port = 6543
58
59 [server:main]
60 port = 6543
61
62=== modified file 'default.ini'
63--- default.ini 2013-09-04 10:26:28 +0000
64+++ default.ini 2013-11-06 23:15:48 +0000
65@@ -58,6 +58,10 @@
66 # text)
67 days_of_revisions = 30
68
69+# The port to hit up for proof. This should match up the server:main port
70+# below.
71+proof.port = 2464
72+
73 [server:main]
74 use = egg:Paste#http
75 host = 0.0.0.0
76
77=== modified file 'requirements.txt'
78--- requirements.txt 2013-11-05 00:24:42 +0000
79+++ requirements.txt 2013-11-06 23:15:48 +0000
80@@ -3,7 +3,7 @@
81 Beaker==1.6.4
82 bzr==2.5.1
83 Chameleon==2.5.1
84-charm-tools==1.1.2
85+charm-tools==1.1.2-charmworld
86 Cheetah==2.4.4
87 colander==0.9.9
88 configobj==4.7.2

Subscribers

People subscribed via source and target branches

to all changes: