deploy script changes
by James Bowes
Hey all:
I've added two new env vars that the deploy script can now recognize:
FORCECERT - force all certificates to be regenerated
HOSTNAME - override the CN in your certs
Use it like:
$> FORCECERT=1 HOSTNAME=localhost buildconf/scripts/deploy
And no more CN=XX!
-James
13 years, 11 months
A Unit Testing + Guice Question
by Devan Goodwin
I would like to be able to have an individual unit test configure the
Principal object that Guice will inject into the component I'm
testing. Currently this is done in Guice Modules and thus doesn't
really allow you to change bindings on a test by test basis that I can
find. Anyone know of a way?
I've got a workable solution but it's not real pretty, bind
Principal.class to a TestPrincipalProvider (all exists today),
TestPrincipalProvider calls out to a new singleton object to get the
actual Principal. The individual tests can also get access to that
singleton and configure the result they'd like to be returned.
Singleton needs to be cleared in teardown.
It seems like there *must* be a way to do this on the fly with Guice
but I can't find it yet. I did some digging and found mention of some
introspection capabilities in Guice but nothing I tried seems to work,
and I've yet to locate any examples of anyone doing this.
Thoughts?
Devan
--
Devan Goodwin <dgoodwin(a)rm-rf.ca>
http://rm-rf.ca
13 years, 11 months
On API Versioning
by Bryan Kearney
One of the backlog items talks about API versioning:
(E2) As an application integrator, I would like to define what version
of the API I support in order to be protected from API changes.
The currenting thinking I am hearing is that you could use the media
type for this, but it would be easier to just use the URL Path
/candlepin/some/resource
candlepin/v2/some/resource
where no v implies v1.
If folks are comfortable with that, it would mean no work until we do
v2. I would move this off the backlog unless there were concerns.
Comments?
-- bk
13 years, 12 months
RPM Building checkpoint
by Adam Young
I just had a successful build with all unit tests passing.
In order to do this, I needed the version of buildr I created, and
called buildr from the command line with:
buildr -f buildfile.new -r localbuild.rb package
localbuild.rb is checked in, but I haven't added my version of the
buildfile: I'll attach it here. I've tried to keep the versions of the
RPMs I use consistant with the ones from the original buildfile. The
biggest diversion is quartz, which has a very heavy dependency list, and
on versions of jakarta-commons that are not compatible with the rest of
the project. This, I've used a much older version of quartz. If this
proves to be a problem, I can battle through getting the more recent one
built.
These are the JPackage RPMS I have installed. These is a mix of 5 and 6
in there.
jakarta-commons-logging-1.1.1-2.jpp6.noarch
jboss-transaction-1.0.1-api-5.0.1-2.jpp6.noarch
jakarta-commons-httpclient-3.1-1.jpp6.noarch
geronimo-specs-poms-1.2-13.jpp5.noarch
jboss-javaee-poms-5.0.1-2.jpp6.noarch
geronimo-specs-poms-1.2-13.jpp6.noarch
jdom-1.1.1-2.jpp6.noarch
hibernate3-ejb-persistence-3.0-api-1.0.2-4.jpp6.noarch
aopalliance-1.0-5.jpp6.noarch
antlr-2.7.6-7.jpp6.noarch
dom4j-1.6.1-12.jpp6.noarch
asm-1.5.3-7.jpp5.noarch
jakarta-commons-logging-jboss-1.1-4.jpp5.noarch
hibernate3-entitymanager-3.4.0-2.7.jpp6.noarch
jboss-common-core-2.2.14-2.jpp6.noarch
glassfish-javamail-1.4.0-4.jpp6.noarch
hibernate3-annotations-3.4.0-1.4.jpp6.noarch
plexus-containers-component-api-1.0-0.a32.3.jpp5.noarch
geronimo-ejb-3.0-api-1.2-13.jpp5.noarch
geronimo-jta-1.1-api-1.2-13.jpp6.noarch
jboss-common-logging-spi-2.1.0-2.jpp6.noarch
glassfish-jaf-1.1.0-6.jpp6.noarch
hibernate3-commons-annotations-3.1.0-3.jpp6.noarch
jakarta-commons-modeler-2.0-5.jpp5.noarch
cglib-2.2-4.jpp6.noarch
I think the glassfish ones are required for building quartz, and are not
strictly speaking necessary.
This is an incomplete list of the ones I've built by hand:
guice-throwingproviders-2.0-4.young.noarch
guice-assistedinject-2.0-4.young.noarch
jakarta-commons-cli-1.2-4.young.noarch
jta-1.1-3.young.noarch
persistence-api-1.0-3.young.noarch
hibernate-commons-annotations-3.3.0.ga-1.young.noarch
jakarta-commons-dbcp-1.4-3.young.noarch
servlet-api-2.5-3.young.noarch
jakarta-commons-collections-testframework-3.2.1-5.young.x86_64
guice-multibindings-2.0-2.young.noarch
commons-dbcp-1.4-3.young.noarch
hibernate3-validator-3.1.0-4.young.noarch
resteasy-guice-1.2.1.GA-4.young.noarch
hibernate-tools-3.2.4.GA-3.young.noarch
guice-2.0-5.young.noarch
jakarta-commons-collections-3.2.1-5.young.x86_64
guice-servlet-2.0-2.young.noarch
emma-2.0-0.5312.5.fc12.noarch
I only recently started tagging my builds with young, so I have others
that were built with fc12.
Here is a list of RPMS I've forced in with --nodeps.
freemarker-2.3.15-1.jpp5.noarch.rpm
jdom-1.1.1-2.jpp6.noarch.rpm
dom4j-1.6.1-12.jpp6.noarch.rpm
jakarta-commons-modeler-2.0-5.jpp5.noarch.rpm
quartz-1.5.2-7.fc12.noarch.rpm
geronimo-ejb-3.0-api-1.2-13.jpp5.noarch.rpm
On 04/27/2010 02:49 PM, Jesus Rodriguez wrote:
> Adam,
>
> I'm in the process of writing a script that will convert
> your MySpecs tree into something I can use tito with to submit
> the pkgs into koji.rhndev.
>
> Basically the structure would be one dir per project, for example,
> emma would be turned into:
>
> MySpecs/emma
> MySpecs/emma/emma.spec
> MySpecs/emma/emma-2.0.5312-build_xml.patch
> MySpecs/emma/emma-2.0.5312-code-source.patch
> MySpecs/emma/emma-2.0.5312-dependencies_xml.patch
> MySpecs/emma/emma-2.0.5312-no-javac-target.patch
> MySpecs/emma/emma-2.0.5312-no-version-stamp-tool.patch
> MySpecs/emma/emma-2.0.5312.pom
> MySpecs/emma/emma-2.0.5312-src.zip
> MySpecs/emma/emma_ant-2.0.5312.pom
>
> In the process of writing my script I found that some of the
> Sources / Patches referenced by the spec files are NOT in
> your SOURCES directory.
>
> For example,
>
> ls: cannot access SOURCES/buildr-buildpath.patch: No such file or directory
> ls: cannot access SOURCES/heckle-local.patch: No such file or directory
>
> Do these need to be checked in? where are they?
>
> The reason behind what I'm doing is very similar to the thirdparty
> tree we built for spacewalk. It allowed us to manage third party
> packages which were not in fedora/rhel that we needed in koji.rhndev
> to build spacewalk. This is the example same situation with the
> packages in your MySpecs. This will all go away once we push
> these upstream, but for now I think this will work.
>
> My plan was to:
>
> - get the script written (mostly done)
> - fork MySpecs on github
> - run the script
> - prep repo for tito
> - commit / push
> - have you do a pull request to merge in the changes
>
> Thoughts?
>
> jesus
>
>
13 years, 12 months
Re: On API Versioning
by Justin Harris
----- "Jesus Rodriguez" <jesusr(a)redhat.com> wrote:
> On Tue, Apr 27, 2010 at 10:26:40AM -0300, Devan Goodwin wrote:
> > The v2 in the URL is gross but it would help with keeping the code
> > reusable I think as we could fork to different resources inheriting
> > from common parent classes. Not sure if we could do the same with
> > media type checking, at least not as easily.
> >
> > Would the plain URL always be the latest and greatest with vX for
> > those who want stability? Or is it no vX assumed to be v1 and we
> > increment for all future releases.
> >
>
> based on bryan's email 'no v implies v1'.
>
> What will our deprecation policy be? mark it deprecated and
> it gets removed in the next version?
>
> Also, having the v2 in front of the resources makes it a little
> harder
> to reuse code, but how many versions will we have? 2? 3? n?
> I'm thinking no more than 3, personally 2 would be great.
>
> If the v2 was after the resource we could actually reuse the
> same Resouce classes, i.e.
>
> GET /candlein/owner/v2/
>
> This would simply be:
>
> @GET
> @Path("/v2")
> public Owner getOwnerNew(...)
>
> With the v2 in front of the Resource we'll have to create a new
> set of resource classes.
I would be very careful about this. Putting the version higher up conflicts with the REST semantics. I know the intent here, but convention would imply that that GET /candlepin/owners/v2 would be getting an owner named "v2".
So that's a -1 from me. :)
>
> jesus
>
> --
> jesus m. rodriguez | jesusr(a)redhat.com
> principal software engineer | irc: zeus
> red hat systems management | 919.754.4413 (w)
> rhce # 805008586930012 | 919.623.0080 (c)
> +---------------------------------------------+
> | "Those who cannot remember the past |
> | are condemned to repeat it." |
> | -- George Santayana |
> +---------------------------------------------+
>
> _______________________________________________
> candlepin mailing list
> candlepin(a)lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/candlepin
13 years, 12 months
Scrum status for Mon Apr 26
by Adam Young
Sorry for missing todays scrum,. Here is the Readers's
Almanac^H^H^H^H^H^H^H^H^H^H^H^H^H^HMy scrum status for today.
Still wokring on getting the build to complete using a JPackage
repository. WHile the version numbers are now much closer than last
week when I got it to compile, there is still a problem when I use a
local m2 repo to store the MAven jars, regardless of where I fetch them.
To reproduce: add the followng line to your buildfile and you should see
the same thing:
Buildr.repositories.local = "target/m2repository"
This leads me to think that we have some sort of "bleed over" in the
build process, whereby we are getting packages from a Jar not specified
in the buildfile.
Looking at the error message, it looks like the root cause is:
] Caused by: java.util.MissingResourceException: Can't find bundle for
base name org.hibernate.validator.resources.DefaultValidatorMessages,
locale en_US
[junit] at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1539)
Which leads me to think that a JAR has been built without the
.properities files for I18N.
Today, I hunt this bug!
13 years, 12 months
git commit messages
by jesus rodriguez
It would be helpful if folks could format their git commit message
with a one line summary (80 char or less), followed by a blank line
then a more lengthy detailed description (if necessary).
For example,
lot's of code cleanup, removed dead code.
Removed unused imports
Removed a bunch of unused code
etc.
This simple change will help make the automated changelogs easier
to consume since I don't have to clean them up.
Thanks
jesus
--
jesus m. rodriguez | jesusr(a)redhat.com
principal software engineer | irc: zeus
red hat systems management | 919.754.4413 (w)
rhce # 805008586930012 | 919.623.0080 (c)
+---------------------------------------------+
| "Those who cannot remember the past |
| are condemned to repeat it." |
| -- George Santayana |
+---------------------------------------------+
14 years
Fwd: Re: [rest-discuss] Bussiness layer error handling
by Bryan Kearney
For when we talk about validation.
-- bk
-------- Original Message --------
Subject: Re: [rest-discuss] Bussiness layer error handling
Date: Sun, 18 Apr 2010 10:57:26 +0200
From: Jan Algermissen <algermissen1971(a)mac.com>
To: Jørn Wildt <jw(a)fjeldgruppen.dk>
CC: Rest List <rest-discuss(a)yahoogroups.com>
On Apr 17, 2010, at 9:22 PM, Jørn Wildt wrote:
> Consider the situation where a client PUTs a new representation of some
> business object, for instance an update to an existing customer. On the
> server side the software detects that some mandatory fields are not
> completed. How should this information be returned to the client?
>
> I want to be able to say more than just "400 Fields X,Y and Z needs
to be
> completed" - the error information should be encoded in a structured
way.
Beware that you cannot redefine the existing HTTP status codes. 400 means
Bad Request and not something application specific. What you should do
is choose the most appropriate HTTP error code and, as you suggest,
include the details in the body. In your example, that would be 422
Unprocessable Entitye (== syntactically correct, but semantic errors)
Jan
>
> My first shot is to define an error media-type like
> application/vnd.error+xml in which I can embed all sorts of error
> information. The the HTTP response could be:
>
> 400 Fields X,Y and Z needs to be completed
> Content-Type: application/vnd.error+xml
>
> <errors>
> <error>...</error>
> </errors>
>
>
> Is this on the right track? Are there any existing media types for this?
>
> Thanks, Jørn
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
-----------------------------------
Jan Algermissen, Consultant
NORD Software Consulting
Mail: algermissen(a)acm.org <mailto:algermissen%40acm.org>
Blog: http://www.nordsc.com/blog/ <http://www.nordsc.com/blog/>
Work: http://www.nordsc.com/ <http://www.nordsc.com/>
-----------------------------------
__._,_.___
Reply to sender <mailto:algermissen1971@mac.com?subject=Re:
[rest-discuss] Bussiness layer error handling> | Reply to group
<mailto:rest-discuss@yahoogroups.com?subject=Re: [rest-discuss]
Bussiness layer error handling> | Reply via web post
<http://groups.yahoo.com/group/rest-discuss/post;_ylc=X3oDMTJxMzU2ZjZrBF9T...>
| Start a New Topic
<http://groups.yahoo.com/group/rest-discuss/post;_ylc=X3oDMTJlcmZmMWtlBF9T...>
Messages in this topic
<http://groups.yahoo.com/group/rest-discuss/message/15298;_ylc=X3oDMTM2YTc...>
(3)
Recent Activity:
* New Members
<http://groups.yahoo.com/group/rest-discuss/members;_ylc=X3oDMTJmdjExYzE5B...>
1
Visit Your Group
<http://groups.yahoo.com/group/rest-discuss;_ylc=X3oDMTJlb2pzdTM0BF9TAzk3M...>
MARKETPLACE
Stay on top of your group activity without leaving the page you're on -
Get the Yahoo! Toolbar now.
<http://us.ard.yahoo.com/SIG=15oq80ha6/M=493064.13983314.13965207.13298430...>
------------------------------------------------------------------------
Welcome to Mom Connection! Share stories, news and more with moms like
you.
<http://us.ard.yahoo.com/SIG=15om2cahc/M=493064.13814537.13965224.10835568...>
------------------------------------------------------------------------
Hobbies & Activities Zone: Find others who share your passions! Explore
new interests.
<http://us.ard.yahoo.com/SIG=15o8vk54s/M=493064.14012770.13963757.13298430...>
Yahoo! Groups
<http://groups.yahoo.com/;_ylc=X3oDMTJkY3NnY2kzBF9TAzk3MzU5NzE0BGdycElkAzQ...>
Switch to: Text-Only
<mailto:rest-discuss-traditional@yahoogroups.com?subject=Change Delivery
Format: Traditional>, Daily Digest
<mailto:rest-discuss-digest@yahoogroups.com?subject=Email Delivery:
Digest> • Unsubscribe
<mailto:rest-discuss-unsubscribe@yahoogroups.com?subject=Unsubscribe> •
Terms of Use <http://docs.yahoo.com/info/terms/>
.
__,_._,___
14 years
Owner / Subscription Certificate Upload Changes
by Devan Goodwin
Upload of certificate now requires authentication, presumably basic. I
modified the deploy script to do this as guest:guest. If you have
users defined in your candlepin.conf, this will break, you need to
either add guest:guest here (auth.user.guest=guest), or remove all
your users in candlepin.conf. (this turns DefaultUserAuthService into
a passthrough, it will accept anything)
If you do not have a candlepin.conf, or there are no users in it, no
changes are required.
When the cert is uploaded, it will be associated with the owner of the
authenticated principal.
I've modified the default user auth service to also create a "Default
Org" if none exists, the first time someone tries to authenticate.
This is also the assumed org for any users in candlepin.conf that
don't have an org. (which you can add there by appending :org name to
their entry)
Let me know if you see any issues!
Cheers,
Devan
--
Devan Goodwin <dgoodwin(a)rm-rf.ca>
http://rm-rf.ca
14 years
hibernate-tools
by Adam Young
OK, I couldn't quite give up on hibernate tools, so I just spent one
more day on it and...well, I got it to compile. I haven't tested it,
nor any of the other RPMS for that matter.
Hibernate tools was the only one I had to patch. Once I accepted that
this was a viable route, I was happy.
In the version of Hibernate that tools was origianlly built against,
therei s a class called CacheFactory that basically pulls in a mother
load of other dependencies. Really poor design. It also has four
symbolic constants for strings. It was only these strings that the rest
of the build needed, which means that this class wasn't even loaded at
run time: javac replaces the strings with the literals anyway. So, I
hacked everything but the symbolic constants out of the class and added
in via a patch.
diff -Nurd
hibernate-tools-needed-classes/org/hibernate/cache/CacheFactory.java
hibernate-tools-3.2.4.GA.new/org/hibernate/cache/CacheFactory.java
---
hibernate-tools-needed-classes/org/hibernate/cache/CacheFactory.java
1969-12-31 19:00:00.000000000 -0500
+++
hibernate-tools-3.2.4.GA.new/org/hibernate/cache/CacheFactory.java
2010-04-15 19:04:03.091745593 -0400
@@ -0,0 +1,13 @@
+//$Id: CacheFactory.java 5685 2005-02-12 07:19:50Z steveebersole $
+package org.hibernate.cache;
+
+/**
+ * @author Gavin King
+ */
+public final class CacheFactory {
+
+ public static final String READ_ONLY = "read-only";
+ public static final String READ_WRITE = "read-write";
+ public static final String NONSTRICT_READ_WRITE =
"nonstrict-read-write";
+ public static final String TRANSACTIONAL = "transactional";
+}
With that, I should be done, but Dmitri snuck in yet another dependency
on me today. I'll get that tomorrow.
14 years