Skip to content

Commit ffeff4d

Browse files
committed
Don't error out when repo is not found
We only create a log error, we don't need to error things out. When i wrote that i didn't take into account that folks can add the whole app on a org and some repo would not have a repo cr yet. This mimic other CI behaviours, i.e if you don't have a .github/workflows/ github actions will not bug you if you don't have one on your pull request. https://issues.redhat.com/browse/SRVKP-2918 Signed-off-by: Chmouel Boudjnah <[email protected]>
1 parent 7888eee commit ffeff4d

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

docs/content/docs/guide/repositorycrd.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ If there is multiples CRD matching the same event, only the oldest one will
4141
match. If you need to match a specific namespace you would need to use the
4242
target-namespace feature in the pipeline annotation (see below).
4343

44+
## Explicitely targetting a Target Namespace from a PipelineRun
45+
4446
There is another optional layer of security where PipelineRun can have an
4547
annotation to explicitly target a specific
4648
namespace. It would still need to have a Repository CRD created in that

docs/content/docs/guide/running.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,28 @@ If the pull request author does not meet these requirements,
3434
another user that does meet these requirements can comment `/ok-to-test` on the pull request
3535
to run the PipelineRun.
3636

37+
{{< hint info >}}
38+
If you are using the Github Apps and have installed it on an Organization,
39+
Pipelines as Code will only be initiated when a Repo CR matching one of the
40+
repositories in a URL is detected on a repository belonging to the organization
41+
where the Github App has been installed.
42+
Otherwise, Pipelines as Code will not be triggered.
43+
{{< /hint >}}
44+
3745
## PipelineRun Execution
3846

3947
The PipelineRun will always run in the namespace of the Repository CRD associated with the repo
4048
that generated the event.
4149

42-
You can follow the execution of your pipeline with the
43-
[tkn pac](../cli/#install) cli :
50+
You can follow the execution of your PipelineRun with the [tkn pac](../cli/#install) cli :
4451

4552
```console
4653
tkn pac logs -n my-pipeline-ci -L
4754
```
4855

49-
If you need to show another pipelinerun than the last one you
50-
can use the `tkn pac` logs command and it will ask you to select a PipelineRun
51-
attached to the repository :
56+
If you need to show another pipelinerun than the last one you can use the `tkn
57+
pac` logs command and it will ask you to select a PipelineRun attached to the
58+
repository :
5259

5360
```console
5461
tkn pac logs -n my-pipeline-ci

pkg/pipelineascode/match.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,6 @@ func (p *PacRun) verifyRepoAndUser(ctx context.Context) (*v1alpha1.Repository, e
5656
msg := fmt.Sprintf("cannot find a namespace match for %s", p.event.URL)
5757
p.eventEmitter.EmitMessage(nil, zap.WarnLevel, "RepositoryNamespaceMatch", msg)
5858

59-
status := provider.StatusOpts{
60-
Status: "completed",
61-
Conclusion: "skipped",
62-
Text: msg,
63-
DetailsURL: "https://tenor.com/search/sad-cat-gifs",
64-
}
65-
if err := p.vcx.CreateStatus(ctx, p.run.Clients.Tekton, p.event, p.run.Info.Pac, status); err != nil {
66-
return nil, fmt.Errorf("failed to run create status on repo not found: %w", err)
67-
}
6859
return nil, nil
6960
}
7061

0 commit comments

Comments
 (0)