fostering open source contributions says that it can discourage contribution by
conveying a false sense of "code ownership". Marking territory is negatively
affecting collaboration. See http://www.youtube.com/watch?v=ZSFDm3UYkeE
* basically get rid of the scheme and apisrv mess - instead directly use the apiurl (== <protocol>://<host>) for everything
* some other minor cleanups here and there
* everyone who has a scheme or apisrv entry in his ~/.oscrc will get a deprecation warning but it's still working (at some point in the future we might remove these code paths)
* when writing a new ~/.oscrc store the apiurl in the conffile [fixes#478054]
- while being at it:
* fixed#478054 ("osc asks for build.o.o credential even if -A<somelocalapi> is always used")
* fixed#478052 ("osc backtrace on password entry (first startup)")
* rework buildinfo parser.
* handle new (or rather, future) attributes
named noinstall, package (we call it repopackage), repoarch.
* handle kiwi builds.
The urllist template (for constructing download URLs) was changed to
make the '_repository' part variable.
OscConfigParser() behaves like a normal ConfigParser() object. The
only differences is that it preserves the order+format of configuration entries
and that it stores comments.
In order to keep the order and the format it makes use of the ConfigLineOrder()
class.
- removed .netrc cruft from the conf module
- other config cleanups
* extra-pkgs and urllist settings can be separated by a comma and/or whitespace:
'extra-pkgs: foo, bar xyz'
* 'True', 'False' etc. are accepted values for boolean options
Default is "extra-pkgs = vim gdb strace" -- and it can be overridden with -x ''
on the commandline, or set to empty in the config. [bnc#345142]
- make tilde expansion work on the packagecachedir setting
https://forgesvn1.novell.com/svn/opensuse/branches/buildservice/osc-exception-handling
........
r3774 | poeml | 2008-04-22 17:39:45 +0200 (Tue, 22 Apr 2008) | 3 lines
A first draft on implement systematic exception handling:
Add errors.py with some exceptions defined, and babysitter.py to handle them
........
r3775 | poeml | 2008-04-22 22:34:12 +0200 (Tue, 22 Apr 2008) | 9 lines
- new global options:
--debugger jump into the debugger before executing anything
--post-mortem jump into the debugger in case of errors
-t, --traceback print call trace in case of errors
- traceback and post_mortem can also be set in .oscrc.
- catch more errors (HTTPError).
- make config accessible from outside of the Osc instance, by making it a class
attribute
........
r3779 | poeml | 2008-04-23 00:55:49 +0200 (Wed, 23 Apr 2008) | 5 lines
- new global option:
-d, --debug print info useful for debugging
- catch some more errors (HTTPError), with OscHTTPError which isn't very
advanced yet.
........
r3781 | Marcus_H | 2008-04-23 01:02:00 +0200 (Wed, 23 Apr 2008) | 2 lines
- added OscConfigError class (just for testing).
- small change in the signature of the OscBaseError constructor (actually we should get rid of the 'args' tuple because it will be deprecated sooner or later
........
r3782 | Marcus_H | 2008-04-23 02:02:13 +0200 (Wed, 23 Apr 2008) | 2 lines
- access the prg.conf.config dict in a save way - this way we avoid AttributeErrors if the prg.conf.config dict doesn't exist
- in case of an configparser error we have to use the prg.options object directly (this was removed in r3781 by accident)
........
r3787 | poeml | 2008-04-23 09:23:56 +0200 (Wed, 23 Apr 2008) | 4 lines
- remove local exception handling from do_req
- for HTTPError, print details (headers and response) when in debug mode
- catch AttributeError
........
r3789 | poeml | 2008-04-23 16:23:14 +0200 (Wed, 23 Apr 2008) | 4 lines
- errors: add two new classes named OscWrongOptionsError and OscWrongArgsError
- commandline: raise instances of the new errors in a number of places
- commandline: add get_cmd_help() to Osc instance which returns the formatted help of a subcommand
........
r3790 | Marcus_H | 2008-04-23 16:48:28 +0200 (Wed, 23 Apr 2008) | 4 lines
- added 2 new exception classes: OscNoConfigfileError and OscIOError
- added new method write_config() to the conf.py module: This method writes osc's configuration file
- minor cleanups in the conf module
........
r3791 | poeml | 2008-04-23 17:11:07 +0200 (Wed, 23 Apr 2008) | 3 lines
small compatibility fix for r3790: try-except-finally isn't supported in
python-2.4.2, thus do the same as try-except inside a try-finally.
........
r3792 | poeml | 2008-04-23 17:37:53 +0200 (Wed, 23 Apr 2008) | 2 lines
fix up the remaining places regarding handling of errors related to commandline parsing
........
r3793 | poeml | 2008-04-23 17:40:34 +0200 (Wed, 23 Apr 2008) | 3 lines
raise a NoWorkingCopyError in osc.core.store_read_project() in case of an
IOError
........
r3798 | Marcus_H | 2008-04-23 23:55:24 +0200 (Wed, 23 Apr 2008) | 1 line
ported -r3797 from trunk
........
r3802 | Marcus_H | 2008-04-24 11:00:55 +0200 (Thu, 24 Apr 2008) | 1 line
ported -r3801 from trunk
........
r3805 | poeml | 2008-04-24 12:52:30 +0200 (Thu, 24 Apr 2008) | 2 lines
raise OscHTTPError in show_pattern_meta(), replacing local error handling
........
r3817 | poeml | 2008-04-24 20:21:32 +0200 (Thu, 24 Apr 2008) | 9 lines
- remove errors.OscHTTPError again.
it seems simpler to use urllib2.HTTPError instead (and just add a specific
error text message where appropriate, and re-raise)
- for 404s, check out _which_ part was not found
it is very ugly, but may be considered Good for pragmatic reasons
- removed local exception handling and workaround for returned 500's from
delete_package() and delete_project(), thereby getting rid of 4 possible exit
points.
........
r3818 | Marcus_H | 2008-04-24 22:36:17 +0200 (Thu, 24 Apr 2008) | 1 line
- this check is superfluous because every HTTPError instance has a code attribute
........
r3819 | poeml | 2008-04-25 00:39:39 +0200 (Fri, 25 Apr 2008) | 1 line
remove a forgotten debug line from core.delete_project()
........
r3820 | poeml | 2008-04-25 10:07:58 +0200 (Fri, 25 Apr 2008) | 2 lines
- ditch local error handling from wipebinaries(), rebuild(), and abortbuild()
........
r3821 | poeml | 2008-04-25 10:56:38 +0200 (Fri, 25 Apr 2008) | 2 lines
It is never needed to import the exception module.
........
r3822 | poeml | 2008-04-25 11:13:39 +0200 (Fri, 25 Apr 2008) | 4 lines
- when going into the debugger with --post-mortem, always print a traceback before
(thus implying -t)
- do not jump into the debugger if not on a TTY, or working in interactive mode
........
r3827 | poeml | 2008-04-25 13:07:46 +0200 (Fri, 25 Apr 2008) | 9 lines
- add errors.OscWorkingCopyOutdated, which takes a tuple with three args:
path to working copy, current rev, expected rev
- add handler for urllib2.URLError errors to the babysitter
- simplify the OscWrongArgsError and OscWrongOptionsError handlers, by removing
the extra line "Sorry, wrong ..." that was printed before the messages given
when the error was raised.
- remove one more errors.OscHTTPError which was still there, and raise
urllib2.HTTPError instead (show_package_meta())
........
r3829 | poeml | 2008-04-25 14:19:10 +0200 (Fri, 25 Apr 2008) | 11 lines
- comment some methods in osc.core which are used by nearly all do_* methods in
osc.commandline
- improve "is not a package/project dir" error messages, by printing the
absolute path tried, instead of '.' for the cwd
- make core.store_read_package() raise a proper NoWorkingCopyError instead of
terminating
- give attribution to things in babysitter.py copied from mercurial
- prefix HTTPError exceptions with 'Server returned an error:'
- remove obsolete local error handling from do_prjresults(), do_importsrcpkg(),
do_repos()
........
r3830 | poeml | 2008-04-25 14:29:35 +0200 (Fri, 25 Apr 2008) | 1 line
catch IOError exceptions in the babysitter
........
r3837 | poeml | 2008-04-25 17:27:36 +0200 (Fri, 25 Apr 2008) | 5 lines
- do_remotebuildlog: raise errors for wrong arguments, remove exits
- raise AttributeError in make_meta_url() instead of exiting
- delete unused method core.delete_server_files()
- replace exit call inside make_meta_url() with an AttributeError
........
r3838 | poeml | 2008-04-25 17:49:18 +0200 (Fri, 25 Apr 2008) | 1 line
simplify the check in do_checkout if a project exists, by using show_project_meta() instead of meta_exists
........
r3839 | poeml | 2008-04-25 18:31:26 +0200 (Fri, 25 Apr 2008) | 6 lines
- commandline do_checkout(): change the order of the two checks, first do the
(cheaper) check for existing directory
- core.core checkout_package(): simplify the check in if the package
exists, by using show_package_meta() instead of meta_exists
Let it throw an exception, instead of using sys.exit().
........
r3841 | Marcus_H | 2008-04-27 15:48:06 +0200 (Sun, 27 Apr 2008) | 5 lines
- added 2 new exception classes: PackageError() and PackageExistsError. The PackageError() class is meant to be the base class for all subsequent package exceptions.
- get rid of 2 sys.exit(1) calls
- make the update() method of the Project() class safer: in any case we have to write the _packages file otherwise the package tracking will be screwed up.
- minor fix in delPackage(): use getTransActPath() when printing out the filename
........
r3842 | Marcus_H | 2008-04-27 16:52:55 +0200 (Sun, 27 Apr 2008) | 3 lines
- make the commit() method safe: in any case we have to write the _packages file otherwise the package tracking will be screwed up.
- removed another sys.exit(1): raise an exception if a package is missing when doing a commit. For now we use the PackageExistsError() exception but this might change in the future (updated description of PackageExistsError() according to this change)
........
r3848 | poeml | 2008-04-28 12:46:45 +0200 (Mon, 28 Apr 2008) | 3 lines
rename several error classes, dropping the "Osc" prefix, and "Error" suffix in
cases where they don't really make sense.
........
r3849 | poeml | 2008-04-28 12:57:32 +0200 (Mon, 28 Apr 2008) | 3 lines
- rename osc.errors module to osc.oscerr, to make it easier to import it from
other programs and have a crystal clear namespace
........
r3850 | poeml | 2008-04-28 13:26:12 +0200 (Mon, 28 Apr 2008) | 2 lines
split PackageExists exception class into PackageExists and PackageMissing
........
* createPackageDir(): create and initialize a new package dir in
the given project.
* get_apiurl_usr(): returns the username for a certain apiurl
* get_configParser(): returns an ConfigParser() object which can be
used for parsing the ~/.oscrc file
- fixed username issues when creating a new package (the problem was
that the username for the default host was used and not the one for
that specific apiurl)
- some small fixes in the do_importsrcpkg() method
get_config(override_conffile = None,
override_http_debug = None,
override_apisrv = None)
Thus, it should be possible to use the osc module with one simple
conf.get_config() call. It is no longer required to set up the api url in the
config dict, and call conf.init_basicauth().
which was still using sys.argv
- build: use own api server as upstream URL in urllist. So far,
api.opensuse.org was hardcoded in the download URL [#265211].
a URL now, so the variable "scheme" which was needed in addition before
becomes obsolete. For backward compatibility, a hostname (and scheme
variable) are still accepted. Likewise, the auth sections in the config take
a URL now, and a hostname:port to keep old config working.
Furthermore, apisrv can be overridden by -A on the commandline. HTTP or HTTPS
scheme is determined from the URL. Credentials must be configured in .oscrc.
Bump version to 0.95.
New features:
- implement "rebuild all failed packages", via --failed option in rebuildpac
subcommand (new api route)
- status -v shows all files, including unmodified ones
- suppress the legend in prjresults by default (show with -l)
- add global options to override config
- can use arbitrary api server via global -A option
- -H enables HTTP traffic debugging
- --version
Bugfixes:
- fix typo in delete_project() (the line building up the URL got lost)
- fix the commit subcommand's arguments. This works correctly now:
osc ci ../test/onlyinwc `pwd` fstab ../test/f2
- fix buildinfo subcommand, if no specfile is posted. Broke with the recent URL
handling rewrite, but didn't seem to bother because the build subcommand
always sends the specfile.
- try to fix buildhistory route, but it might be gone actually (need to pursue)
- add --clean/--noinit to osc build help output
- adding http_GET/POST/PUT/DELETE() functions, which dispatch to
http_request(), and use them everywhere
- removing othermethods.py
- keeping urlopen(), in case it is used from externally, but have it print out
a "depracated" message
- finally, implementing a global HTTP debug mode
to create a user if it doesn't exist yet. A new command 'usermeta' replaces
'id' respectively 'userid'.
- add preliminary support for doing uploads with a subsequent "commit" request
(not switched on now, since I want to do more testing on this, and there is
no way to pass on a commit message yet anyway.)
- add runtime check for build.rpm version, so the rpm package dependencies is
no longer required
- fix typo introduced last time in the editmeta, deletepac, deleteprj commands
- rewrite the PUT and DELETE request methods to
- transparently handle HTTPS
- handle path parameters (for commits)
- send user agent
- rename get_user_id() function to get_user_meta()
- change copyright notice from Peter Poeml to Peter Poeml / Novell Inc.
- fix testsuite
- add CREDITS file
- move all configuration code into module osc/conf.py
- now, the API server can be configured in .oscrc with
apisrv = ...
- also, 'scheme' (http/https) is no longer a module variable but can be
configured
- all config is in DEFAULT
- ignore vim swap files
- use urllib() convenience wrapper in some functions that used
urllib2.urlopen() and had their own error handling. Instead, it seems to make
sense -- in the future-- to create our own errors and propagate them up, in
cases where the error handling of urlopen() is too generic
- rename get_slash_source() to meta_get_project_list() for consistency
- show local time in get_buildhistory(), not UTC
- rewrite help text of 'rebuildpac' command
- allow to run commandline.py from the commandline (without the wrapper)
- don't send a space when doing a POST request without body