Add custom variables when you schedule a manual pipeline, they will be added to the existing one already defined at project level. If the variable is already there, it will be overwritten with the new value.
Proposal
on variable functionality:
a user can edit existing variables
by editing its text contents
but can also, as a faster way, just delete a whole row of variables with the - button
as soon as one has some content in it a new one appears
When you run or schedule a pipeline manually, you may want to add or overwrite variables that are passed to jobs in order to modify the behavior just for that specific instance. In the same place you request the manual pipeline to be created, you can now also specify an additional set of variables that are added to the list of variables already defined for the project, overwriting existing ones in case they're already present.
Since there is backend work associated with this, and it hasn't been scheduled, I'm adding the backend label and unassigning myself for the time being.
Is there a way to tell a job that it is scheduled if you want to run a certain type of job on the schedule vs on commit without using variables? Like a stage build?
In one of our use cases we have a dev environment which gets updated on commit and then a stage env that gets built daily so it is somewhat stable for UAT testing.
@ayufan Do you need any FE work on this or do you want the BE to do everything? I think it would be nice to use some jQuery to add new form elements. I can help you with that if you want. I am assigned to work on the FE here so let me know.
We have two parts, Backend who needs to prepare groundwork, and Frontend which needs to expose these settings. Yes, we may need to add some jQuery to make it nice.
@jschatz1 I know it's pretty small, but you might also consider using Vue for the variables list here. We're already using it for interval pattern selection (source) in this form, and where this form is headed (https://gitlab.com/gitlab-org/gitlab-ce/issues/30675), I think the more we can do in Vue, the better.
@ayufan I don't think so. As long as you expose existing variables in the view and accept new key/value pairs on form submission, you shouldn't need to create an API.
If your project is public, passing the token in plain text is probably not the wisest idea, so you might want to use a secret variable for that purpose.
If you are owner of schedule (as developer) or master => you can read, modify and delete,
If you are developer => you can just list, not read,
This allows only owners and masters to read variables assigned to the schedule. It prevents other developers from hijacking schedules, but allows master to fully control them. Master already has access to Secret Variables.
is there a different design for scheduled pipelines list that includes showing variables once set? I don't see one (and this could be the right choice, so security is guaranteed).
@fabio as far as i know not. There isn't to much screen real estate available and i think these are value that are good to be visible only in the deeper/inspectable view.. only accessible by the right people as you said for security reason. Aside from that.. there can be many variables, plus we have a description field.. where someone could state what is really necessary to understand this
I've just realized I don't need to add new endpoints for manipulating variables. Because the change will happen when user pushes "Add schedule" or "Edit schedule", not when user pushes plus/minus button (i.e. AJAX).
@MadLittleMods AM I correct? If you're expecting new endpoints, let me know.
@dosuken123 No new endpoints needed. Just need to save those variables on form submission and have those variables available in the HAML to render when you edit an existing schedule.
@MadLittleMods I was thinking about a better workflow between FE and BE. And I think it's better to use an intermediate branch instead of targeting master directly.
So it's going to be like
The benefits are
We don't need to merge temporary codes into master (e.g. TODO: FE do somthing here).
We can write feature specs before merging into master branch.
@dosuken123 An intermediate MR works for me . In the past I have just targeted the FE MR against the BE branch, merge the BE branch, and re-target FE against master for final merge.
@zj Yes, if we can find a value through the experimental git-strategy, let's consider updating handbook. Anyway, is there any default workflow when FE and BE work together?
@ayufan I disagree with the new security implications. One strategy to make transient failures surface is to divert from master at some point and every 4 hours or so run the schedule. Your current approach makes that hard for me, as developer, to achieve. Is this by design?
@dosuken123 I'm saying that either we merge that separately (unlikely to happen, as in BE there are some TODO changes). I just propose to merge these two branches now into one and point it to master. Review them together now :)
I targeted the FE MR at the BE branch because the integration branch doesn't have the BE in yet. Once things get stable, we can merge BE into the integration branch, point FE at the integration branch and merge.
@MadLittleMods I closed an MR of integration branch and please never mind. Let's merge FE->BE or BE->FE, if we're ready. That's a usual workflow in GitLab I think.