Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to add custom tasks to TA pipelines #179

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chmeliik
Copy link
Contributor

No description provided.

Copy link

🚀 Preview is available at https://pr-179--konflux-docs.netlify.app

The "example-task" example wasn't useful and the
slack-webhook-notification one isn't a custom task.

Kepp the slack-webhook-notification example but repurpose the section to
be specifically about Slack notifications.

Remove the part about EC issues because it no longer relates to
anything in this doc

Signed-off-by: Adam Cmiel <[email protected]>
Copy link

🚀 Preview is available at https://pr-179--konflux-docs.netlify.app

@chmeliik
Copy link
Contributor Author

/retest

Comment on lines +13 to +15
* Your Task must *not* return a modified `SOURCE_ARTIFACT`.
It's ok if the task modifies the source repo as it executes, but the modifications will be discarded.
The build will use the original, unmodified `SOURCE_ARTIFACT`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

  • It is fine to generate the modified source artifact but that shouldn't be used in any future task that needs to be trusted.
  • This is true for any artifacts consumed (source or cachi2) by trusted tasks (prefetch or build)

Comment on lines +28 to +29
NOTE: The presence of the Task in `.tekton/**` is enough to make it available for use in your Pipelines without any extra configuration;
see link:https://pipelinesascode.com/docs/guide/resolver/[Pipelines-as-Code resolver].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another PR is proposing a different structure (for remote resolvers). Should we address the potential confusion?

https://github.com/konflux-ci/docs/pull/173/files#diff-7de75443c634564136fd1db89ef54619c2483dd2be6d8063cd0ffd764e96476dR73-R82

Copy link
Contributor Author

@chmeliik chmeliik Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, interesting. They are different use cases, but we probably do need to differentiate between them somewhere. Or align, if possible 🤔

That PR: defining a complete "remote" Pipeline (will be referenced from other repos)
This PR: adding a custom Task to a non-remote Pipeline

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I don't feel like this PR needs to include both local and remote pipelines/tasks, but maybe just an acknowledgement the the other exists as well?

Should we just keep this PR scoped down to creating your own custom tasks? Then there can be a separate location where we talk about using remote tasks? These pages can be located next to each other.


Implement the task in e.g. `.tekton/tasks/get-buildah-args.yaml`:

[source,yaml]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a repository where we can create some sample pipelines/tasks: https://github.com/konflux-ci/pipeline-samples

What do you think about propose this task there instead so that readers won't have to extract it out of the documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer inline examples, but if we want that to be the pattern that works too

@@ -0,0 +1,146 @@
= Adding custom tasks

If your pipeline uses xref:advanced-how-tos/using-trusted-artifacts.adoc[Trusted Artifacts],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only talk about TA pipelines here. Can we have a section at the top describing the overall process and then two sections later discussing the uniqueness for TA and PVC pipeline tasks?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will improve the sidebar too as it will provide more context to what content will be on the page: https://pr-179--konflux-docs.netlify.app/how-tos/configuring/adding-custom-tasks/

Screenshot 2024-11-25 at 1 19 16 PM

Comment on lines -119 to -128
taskRef:
params:
- name: name
value: example-task # metadata.name field of the Task
- name: bundle
value: quay.io/tekton-bundle-catalog/example-task-bundle:1.0
# For more details on tekton bundles, refer to https://tekton.dev/docs/pipelines/pipelines/#tekton-bundles
- name: kind
value: task
resolver: bundles
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information is relevant for remote resolvers (along with the undocumented git resolver). Should we include some information/reference to these?

@chmeliik chmeliik marked this pull request as draft November 28, 2024 12:22
@chmeliik
Copy link
Contributor Author

Marking as draft until I have time to rework this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants