Skip to content

Parameters for manual pipelines#4861

Closed
arthurpro wants to merge 3 commits intowoodpecker-ci:mainfrom
arthurpro:feature/manual-parameters
Closed

Parameters for manual pipelines#4861
arthurpro wants to merge 3 commits intowoodpecker-ci:mainfrom
arthurpro:feature/manual-parameters

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.

repo.DELETE("/logs/:number", session.MustPush, api.DeletePipelineLogs)

// requires push permissions
repo.GET("/parameters", api.GetParameterList)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the parameters list also require push privs?

@xoxys
Copy link
Member

xoxys commented Aug 15, 2025

@arthurpro Sorry for the delay. Could you resolve the merge conflicts and look at the open feedback?

@arthurpro
Copy link
Contributor Author

@xoxys sure, I will take a look at that during this week

@qwerty287
Copy link
Contributor

closing as of #5632

@qwerty287 qwerty287 closed this Oct 26, 2025
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.

4 participants