launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #27637
Re: [Merge] ~ilasc/launchpad:revision-status-submission-api into launchpad:master
Diff comments:
> diff --git a/lib/lp/code/interfaces/gitrepository.py b/lib/lp/code/interfaces/gitrepository.py
> index 363356d..6c0db04 100644
> --- a/lib/lp/code/interfaces/gitrepository.py
> +++ b/lib/lp/code/interfaces/gitrepository.py
> @@ -1007,6 +1011,91 @@ class IGitRepositoryEdit(IWebhookTarget, IAccessTokenTarget):
> :raise: CannotDeleteGitRepository if the repository cannot be deleted.
> """
>
> + @operation_parameters(
> + name=TextLine(title=_("The name of the status report.")),
> + git_repository=Int(title=_("Reference to a GitRepository")),
> + commit_sha1=TextLine(title=_("The commit sha1 of the status report.")),
> + date_created=Datetime(
> + title=_("The time when this request was made")),
> + url=TextLine(title=_("The external link of the status report.")),
> + description=TextLine(title=_("The description of the status report.")),
> + result=List(
> + title=_("A list of report result statuses to filter by."),
> + value_type=Choice(vocabulary=RevisionStatusResult)),
This looks like it was transcribed from a search method of some kind. A given revision status report only has a single result, not a list of them.
> + date_started=Datetime(
> + title=_("The time when this report was started.")),
> + date_finished=Datetime(
> + title=_("The time when this report completed.")),
> + log=Int(title=_("Reference to a RevisionStatusArtifact")))
> + @scoped(AccessTokenScope.REPOSITORY_BUILD_STATUS.title)
> + @call_with(user=REQUEST_USER)
> + @export_write_operation()
> + @operation_for_version("devel")
> + def newRevisionStatusReport(user, name, git_repository, commit_sha1,
> + date_created, url=None, description=None,
> + result=None, date_started=None,
> + date_finished=None, log=None):
> + """Create a New Status Report and return its ID.
> +
> + :param name: The name of the new report.
> + :param description: The description of the new report.
> + :param commit_sha1: The commit sha1 for the report.
> + :param result: The result of the new report.
> + """
> +
> +
> +class IRevisionStatusReport(Interface):
> + id = Int(title=_("ID"), required=True, readonly=True)
> +
> + name = TextLine(
> + title=_("The name of the report."), required=True)
> +
> + git_repository = Reference(
> + title=_("The Git repository for which this report is built."),
> + # Really IGitRepository, patched in _schema_circular_imports.py.
> + schema=Interface, required=True, readonly=True)
> +
> + commit_sha1 = Reference(
> + title=_("The Git commit for which this report is built."),
> + schema=Interface, required=True, readonly=True)
> +
> + url = Attribute("The external url of the report.")
> +
> + description = Attribute("A short description of the report.")
> +
> + result = Choice(
> + title=_('Result of the report'), vocabulary=RevisionStatusResult)
> +
> + date_created = Datetime(
> + title=_("When the report was created."), required=True, readonly=True)
> + date_started = Datetime(
> + title=_("When the report was started."))
> + date_finished = Datetime(
> + title=_("When the report has finished."))
> + log = Reference(
> + title=_("The Git commit for which this report is built."),
> + schema=Interface)
> +
> +
> +class IRevisionStatusReportSet(Interface):
> + """The set of all revision status reports."""
> +
> + def new(name, git_repository, commit_sha1, date_created=None,
> + url=None, description=None, result=None, date_started=None,
> + date_finished=None, log=None):
> + """Return a new revision status report.
> +
> + :param name: A text string.
> + :param git_repository: An `IGitRepository` for which the report
> + is being created.
> + :param commit_sha1: The sha1 of the commit for which the report
> + is being created.
> + :param date_created: The date when the report is being created.
> + """
> +
> + def findRevisionStatusReportById(id):
> + """Returns the RevisionStatusReport for a given Id."""
> +
>
> # XXX cjwatson 2015-01-19 bug=760849: "beta" is a lie to get WADL
> # generation working. Individual attributes must set their version to
--
https://code.launchpad.net/~ilasc/launchpad/+git/launchpad/+merge/410373
Your team Launchpad code reviewers is requested to review the proposed merge of ~ilasc/launchpad:revision-status-submission-api into launchpad:master.
References