Adding a new job to Java Specs for non-default plan branch fails to find remote agents available to execute the job when plan is dedicated

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • 10.0.0, 9.2.17, 9.6.5
    • Affects Version/s: 9.3.0, 9.2.1, 9.2.3, 9.3.1, 9.2.4, 9.3.2, 9.2.5, 9.3.3, 9.3.4, 9.2.6, 9.2.0, 9.2.2, 9.2.7, 9.3.5
    • Component/s: Bamboo Specs
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      Adding a new job to Java Specs for non-default plan branch fails to find remote agents available to execute the job when plan is dedicated to remote agents.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create at least one remote agent
      2. Create a simple Java Specs of a plan that contains one stage and one job. For example:
            public Plan plan() {
                final Plan plan = new Plan(new Project()
                        .oid(new BambooOid("gmye0h9lmfb7"))
                        .key(new BambooKey("PROJ"))
                        .name("PROJ"),
                    "PLAN",
                    new BambooKey("PLAN"))
                    .oid(new BambooOid("gmoosvwdsmwz"))
                    .pluginConfigurations(new ConcurrentBuilds())
                    .stages(new Stage("Stage 1")
                            .jobs(new Job("Job 1",
                                    new BambooKey("JOB1"))
                                    .tasks(new VcsCheckoutTask()
                                            .description("Checkout Default Repository")
                                            .checkoutItems(new CheckoutItem().defaultRepository()),
                                        new ScriptTask()
                                            .inlineBody("echo \"starting job 1\""))
                                    .dockerConfiguration(new DockerConfiguration()
                                            .enabled(false))))
                    .linkedRepositories("specs-branch")
                    
                    .triggers(new BitbucketServerTrigger())
                    .planBranchManagement(new PlanBranchManagement()
                            .delete(new BranchCleanup())
                            .notificationForCommitters());
                return plan;
            }
        
      3. Create a linked repository and add the Java Specs to this repository and execute a Specs scan in a main branch.
      4. Create a new branch in the repository and execute the Specs scan of this branch
      5. Dedicate the remote agent to this plan
      6. Now add a new job to the newly created branch in the remote repository and execute the Specs scan again. For example:
            public Plan plan() {
                final Plan plan = new Plan(new Project()
                        .oid(new BambooOid("gmye0h9lmfb7"))
                        .key(new BambooKey("PROJ"))
                        .name("PROJ"),
                    "PLAN",
                    new BambooKey("PLAN"))
                    .oid(new BambooOid("gmoosvwdsmwz"))
                    .pluginConfigurations(new ConcurrentBuilds())
                    .stages(new Stage("Stage 1")
                            .jobs(new Job("Job 1",
                                    new BambooKey("JOB1"))
                                    .tasks(new VcsCheckoutTask()
                                            .description("Checkout Default Repository")
                                            .checkoutItems(new CheckoutItem().defaultRepository()),
                                        new ScriptTask()
                                            .inlineBody("echo \"starting job 1\""))
                                    .dockerConfiguration(new DockerConfiguration()
                                            .enabled(false)),
                                    new Job("Job 2",
                                    new BambooKey("JOB2"))
                                    .tasks(new VcsCheckoutTask()
                                            .description("Checkout Default Repository")
                                            .checkoutItems(new CheckoutItem().defaultRepository()),
                                        new ScriptTask()
                                            .inlineBody("echo \"starting job 2\""))
                                    .dockerConfiguration(new DockerConfiguration()
                                            .enabled(false))))
                    .linkedRepositories("specs-branch")
                    
                    .triggers(new BitbucketServerTrigger())
                    .planBranchManagement(new PlanBranchManagement()
                            .delete(new BranchCleanup())
                            .notificationForCommitters());
                return plan;
            }
        

      Expected Results

      The new added job to the plan branch should identify the correct remote agents that are dedicated to execute the plan. The new job shows the message: "No agent can build this job.".

      Actual Results

      The new added job to the plan branch does not identify the correct remote agents that are dedicated to execute the plan.

      Find some screenshoot of the settings used during this test:

      -> Agent dedication to the plan

      -> Default branch configuration

      -> New branch with the new job configuration

      Workaround

      • Go to Cog Icon >> Agents and remove the dedication for all the remote agents dedicated to the plan. OR
      • Instead of dedicating remote agents to build plans dedicate remote agents to build project.

        1. image-2023-12-05-18-22-13-513.png
          191 kB
          Karel Miranda
        2. image-2023-12-05-18-22-54-666.png
          172 kB
          Karel Miranda
        3. image-2023-12-05-18-26-04-407.png
          85 kB
          Karel Miranda

            Assignee:
            Marcin Gardias
            Reporter:
            Karel Miranda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: