Skip to content

GoCD sends run_instance_count as 0 during pipeline export #7676

@kritika-singh3

Description

@kritika-singh3
Issue Type
  • Bug Report
Summary

During export of any pipeline, GoCD sends a copy of current pipeline config to the plugin. The value of run_instance_count for a job is set to '0'.

Basic environment details
  • Go Version: 20.1.0 (11115-af4bdadd3f6545617327c56f4cb3b92abe4f1181)r
  • JAVA Version: 11.0.1
  • OS: Mac OS X 10.13.6
Steps to Reproduce
  1. Install GoCD Groovy plugin
  2. Define a pipeline test with a job to run with one instance.

Screen Shot 2020-01-29 at 4 29 37 PM

  1. Go to Pipelines SPA.
  2. Find test and click export. Select GoCD Groovy Configuration plugin.
  3. Look at the file generated.
Expected Results

There should no run_instance_count present in the file. Even if present, it should be set to null.

Actual Results

The value of run_instance_count for the job is set to 0

Any other info

If I send the same file as input to the GoCD server, the plugin throws an error stating 0 is not a valid value.
IMO, what the value of run-instance_count should mean:

  • 0: no job instances to run
  • 1 or null: run a single job instance
  • x: partition the task into x parts
  • all: to run on all agents

Currently, if my groovy files contain run_instance_count: '0', the plugin throws an error stating 0 is not a valid value - which is correct.
On setting it to run_instance_count: '1', the GoCD accepts it as a valid pipeline and schedules it. But the resulting job instance is suffixed by -1 which is not the desired results.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions