#1638  when importing build spec elements,cannot see jobs in run menu
Closed
lordran opened 6 months ago

Hi, I have created a project named cicd-commons for build specs resuse. I created a project for test, after I importing the specs, I cannot see these jobs in run menu. Is this a feature or a permission issue? How should I do to display them in run menu?

Robin Shen commented 6 months ago

Run menu only appears after saving the build spec. 


On Nov 6, 2023, at 11:13, Robin Shen <robin@onedev.io> wrote:

lordran opened

Hi, I have created a project named cicd-commons for build specs resuse. I created a project for test, after I importing the specs, I cannot see these jobs in run menu. Is this a feature or a permission issue? How should I do to display them in run menu?


Reply this email to post comment, or click this link for details
lordran commented 6 months ago

How to do a "save" action when importing?

Robin Shen commented 6 months ago

Just save/commit as you normally do when modify a build spec.

lordran commented 6 months ago

I created a job(with same name imported from cicd-commons) in test project:

image.png

even though the job name could appear in run menu now,

image_2.png

but nothing within it (IMO, it should be a copy of same name from cicd-commons):

image_3.png

jbauer commented 6 months ago

@lordran If you import your cicd-commons and just commit, then all jobs defined in cicd-commons appear in the UI with a special icon on it to indicate that it is an imported job. As soon as you create a Job with the same name, it overrides the imported job including all steps. Thus the overriding job has no steps unless you define some steps.

So importing Jobs is only useful if you really have the same job with the same steps for multiple projects. If steps differ slightly between projects then it might be better to define step templates instead of jobs and import these step templates. A step template can contain multiple steps.

It would be nice if OneDev would allow defining a Job with parameters in a commons project and then the project importing that job could configure the job parameters using properties. So you could configure an imported job without loosing all steps. But as far as I know that does not work (yet).

Robin Shen commented 6 months ago

As @jbauer explained, overriding a job means to use a new job to replace imported job. This is something identical when you override a method in OOP.

If you only want to override part of the job, you may consider using property variable in that part of job, and then override the property instead.

lordran commented 6 months ago

@jbauer Thanks for your clarification. Indeed, hope OneDev would have a more powerful Pipeline functionality,I will stay tune on that.

@robin Thanks for your patient reply, I have learned a lot about the "character" of OneDev Pipeline, I will choose proper way according to my case. Hoping Pipeline will become more flexible and powerful, thanks again.

Robin Shen changed state to 'Closed' 6 months ago
Previous Value Current Value
Open
Closed
Robin Shen commented 4 months ago

Run menu only appears after saving the build spec. 


On Nov 6, 2023, at 11:13, Robin Shen <robin@onedev.io> wrote:

lordran opened

Hi, I have created a project named cicd-commons for build specs resuse. I created a project for test, after I importing the specs, I cannot see these jobs in run menu. Is this a feature or a permission issue? How should I do to display them in run menu?


Reply this email to post comment, or click this link for details
issue 1 of 1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
onedev/server#1638
Please wait...
Page is in error, reload to recover