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

Parameters for manual pipelines #4861

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

arthurpro
Copy link
Contributor

@arthurpro arthurpro commented Feb 16, 2025

The Parameters feature introduces a flexible and dynamic way to manage environment variables for manual pipelines.

Key Features:

  • Users can create, update, and delete parameters.
  • Supports various parameter types, including boolean, string, text, password, single and multiple-choice options.
  • Parameter values are configured during manual pipeline creation and passed as environment variables to the pipeline.
  • Environment variables collapsible panel added to pipeline Config tab (see screenshots)

This PR is open for suggestions and improvements.

parameters1

parameters2

parameters3

parameters4

parameters5

parameters6

Introduced backend API endpoints, database operations, and web UI components for creating, updating, listing, and deleting manual pipeline parameters. This update includes tests for datastore functions, integration with the Vue.js web interface, and mock implementation for parameter-related methods.
Refactor boolean value management by introducing a dedicated `booleanValue` ref to enhance reactivity and avoid direct prop mutations. Adjust watchers and logic to ensure consistent conversion between boolean and string representations.
@arthurpro arthurpro marked this pull request as ready for review February 16, 2025 02:40
@qwerty287 qwerty287 added the feature add new functionality label Feb 16, 2025
@qwerty287
Copy link
Contributor

Whoa, thank you very much for your work! This closes #3326, right?

I'm personally not sure if it would be better to define these in the yaml files, but I also see some problems with this, e.g. it would be per-workflow then and we have to pre-fetch the yamls to get the parameters.

And just from a very short overview of your code: You don't need a migration to sync the model, that's handled inside already.

@arthurpro
Copy link
Contributor Author

arthurpro commented Feb 16, 2025

@qwerty287 yes, I looked at #3326 and I really wanted something similar to GitHub workflow inputs. but for that to work we would need to have woodpecker pipeline workflows fully loaded and parsed ahead of running a manual pipeline. that made me rethink the approach. And I found the least invasive and more elegant way to simply plug into existing Additional pipeline variables in the manual pipeline window.
Also I borrowed the idea of Parameters from Jenkins pipelines because I'm using Woodpecker while trying to go away from Jenkins.
Thanks for your feedback! I'll remove the migration.

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

Successfully merging this pull request may close these issues.

2 participants