Part of lp.archiveuploader.nascentupload View In Hierarchy
Represents an upload being born. NascentUpload's responsibilities are: 1. Instantiating the ChangesFile and supplying to it the relevant context. 2. Checking consistency of the upload in overall terms: given all present binaries, sources and other bits and pieces, does this upload "make sense"? 2. Collecting errors and warnings that occurred while processing the upload. 3. Checking signer ACL and keyring constraints. 4. Creating state in the database once we've decided the upload is good, and throwing it away otherwise. 5. Sending email to concerned individuals. The collaborative international dictionary of English defines nascent as: 1. Commencing, or in process of development; beginning to exist or to grow; coming into being; as, a nascent germ. [1913 Webster +PJC] A nascent upload is thus in the process of coming into being. Specifically a nascent upload is something we're trying to get into a shape we can insert into the database as a queued upload to be processed.
Method | __init__ | Setup a NascentUpload for the given ChangesFile. |
Class Method | from_changesfile_path | Create a NascentUpload from the given changesfile path. |
Method | process | Process this upload, checking it against policy, loading it into |
Method | filename | Return the changesfile name. |
Method | is_new | Return true if any portion of the upload is NEW. |
Method | run_and_check_error | Run the given callable and process errors and warnings. |
Method | run_and_collect_errors | Run 'special' callable that generates a list of errors/warnings. |
Method | run_and_reject_on_error | Run given callable and raise EarlyReturnUploadError on errors. |
Method | is_ppa | Whether or not the current upload is target for a PPA. |
Method | getComponents | Return a set of components present in the uploaded files. |
Method | reject | Add the provided message to the rejection message. |
Method | rejection_message | Aggregate rejection messages. |
Method | is_rejected | Returns whether or not this upload was rejected. |
Method | warn | Add the provided message to the warning message. |
Method | warning_message | Aggregates warning messages. |
Method | verify_acl | Check the signer's upload rights. |
Method | checkVersion | Check if the proposed version is higher than the one in archive. |
Method | overrideSourceFile | Overrides the uploaded source based on its override information. |
Method | overrideBinaryFile | Overrides the uploaded binary based on its override information. |
Method | find_and_apply_overrides | Look for ancestry and overrides information. |
Method | do_accept | Accept the upload into the queue. |
Method | do_reject | Reject the current upload given the reason provided. |
Method | storeObjectsInDatabase | Insert this nascent upload into the database. |
Method | overrideArchive | Override the archive set on the policy as necessary. |
Method | _check_overall_consistency | Heuristics checks on upload contents and declared architecture. |
Method | _check_sourceful_consistency | Heuristic checks on a sourceful upload. |
Method | _check_binaryful_consistency | Heuristic checks on a binaryful upload. |
Method | _matchDDEBs | Check and link DEBs and DDEBs in the upload. |
Method | _overrideDDEBSs | Make sure that any DDEBs in the upload have the same overrides |
Method | _reject_with_logging | Helper to reject an upload and log it using the logger function. |
Method | _createQueueEntry | Return a PackageUpload object. |
Parameters | changesfile | the ChangesFile object to be uploaded. |
policy | the upload policy to be used. | |
logger | the logger to be used. |
May raise UploadError due to unrecoverable problems building the ChangesFile object.
Parameters | changesfile_path | path to the changesfile to be uploaded. |
policy | the upload policy to be used. | |
logger | the logger to be used. |
No exceptions should be raised. In a few very unlikely events, an UploadError will be raised and sent up to the caller. If this happens the caller should call the reject method and process a rejection.
An upload may list 'powerpc' and 'all' in its architecture line and yet only upload 'powerpc' because of being built -B by a buildd. As a result, we use the think_* variables as a screen. If the files_X value is true then think_X must also be true. However nothing useful can be said of the other cases.
Raises AssertionError when called for a non-sourceful upload. Ensures a sourceful upload has exactly one DSC. All further source checks are performed later by the DSC.
It copes with mixed_uploads (source + binaries).
Check if the declared number of architectures corresponds to the upload contents.
Matches each DDEB to its corresponding DEB, adding links in both directions. Unmatched or duplicated DDEBs result in upload errors.
This method is an error generator, i.e, it returns an iterator over all exceptions that are generated while processing all mentioned files.
This is required so that domination can supersede both files in lockstep.
UploadError(s) and UploadWarnings(s) are handled.
The so called 'special' callables returns a generator containing all exceptions occurring during it's process.
Currently it is used for {NascentUploadFile, ChangesFile}.verify() method.
The rationale for this is that we want to collect as many errors/warnings as possible, instead of interrupting the checks when we find the first problem, when processing an upload.
This methodology helps to avoid retrying an upload multiple times because there are multiple problems.
Return a text header containing all the warnings raised during the upload processing or None, if no warnings were issued.
The signer must have permission to upload to either the component or the explicit source package, or in the case of a PPA must own it or be in the owning team.
Override target component and section.
Override target component, section and priority.
Anything not yet in the DB gets tagged as 'new' and won't count towards the permission check.
This MAY in extreme cases cause a database error and thus actually end up with a rejection being issued. This could occur, for example, if we have failed to validate the input sufficiently and something trips a database validation constraint.
Parameters | notify | True to send an email, False to not send one. |
build | The build associated with this upload. |
In some circumstances we may wish to change the archive that the uploaded package is placed into based on various criteria. This includes decisions such as moving the package to the partner archive if the package's component is 'partner'.
Uploads with a mixture of partner and non-partner files will be rejected.