public interface RepositoryHookRequest
repository-hook
modules for inspection
(pre-hooks
and
post-hooks
). The request describes the
ref changes
that are about to be made (pre-hooks), or that have just been made
(post-hooks).
A request is marked as a dry-run
request when the proposed ref changes
need to be quickly verified, for instance to determine whether a button in the web UI should be enabled.
Hooks that are called with a dry-run
request should avoid expensive checks and operations.
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getContext()
Retrieves any additional context that was supplied to the request.
|
Collection<RefChange> |
getRefChanges() |
Repository |
getRepository() |
Optional<ScmHookDetails> |
getScmHookDetails() |
RepositoryHookTrigger |
getTrigger() |
boolean |
isDryRun() |
@Nonnull Map<String,Object> getContext()
On dry runs
, the context will always be empty.
@Nonnull Collection<RefChange> getRefChanges()
empty
for some dry-run requests where the
target hash is not yet known because the relevant commit hasn't been created yet. As an example, this is
the case for merge requests
. In these cases, the specialized request type should
provide sufficient information about the proposed change. For MergeHookRequest
, this would be
MergeHookRequest.getFromRef()
and MergeHookRequest.getToRef()
.@Nonnull Repository getRepository()
@Nonnull Optional<ScmHookDetails> getScmHookDetails()
@Nonnull RepositoryHookTrigger getTrigger()
boolean isDryRun()
true
if this hook is a dry-run request, otherwise false
Copyright © 2019 Atlassian. All rights reserved.