Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Does the Bamboo REST API allow me to update the Change Detection options

When I set the Include/Exclude files dropdown to "Include only changes that matches to the following pattern", I want to update the associated File Pattern.

I want to update the Change Detection options from the Bamboo REST Api if possible.

1 answer

Hi Terry,

I suggest you using Bamboo Java repository specs. This is how you can create a plan with this feature: Tutorial: Bamboo Java Specs stored in Bitbucket Server - Atlassian Documentation

Once you have a plan in this format you should be able to change the file pattern by performing commits into the plan configuration repository. As soon as Bamboo detects the change in the plan configuration, the file pattern will be updated.

In case you want to understand more about Bamboo specs, please check this page: Bamboo Specs - Atlassian Documentation.

At the moment of this answer, Bamboo does not have a REST api endpoint to update this configuration.

I am using Java Specs.

The plan I am using uses a Linked Repo called TRYMEsecond.

Capture.PNG

That Linked Repo has the required pattern in it (i.e. ^(Second).* ) but I cannot see the value of the file pattern in the java spec:

public Plan plan() {
        final Plan plan = new Plan(new Project()
                .oid(new BambooOid("t3bp047ej285"))
                .key(new BambooKey("TRY"))
                .name("try"),
            "Second",
            new BambooKey("SEC"))
            .oid(new BambooOid("t31zsiu6pd1i"))
            .pluginConfigurations(new ConcurrentBuilds()
                    .useSystemWideDefault(false))
            .stages(new Stage("Default Stage")
                    .jobs(new Job("Default Job",
                            new BambooKey("JOB1"))
                            .tasks(new VcsCheckoutTask()
                                    .description("Checkout Default Repository")
                                    .checkoutItems(new CheckoutItem().defaultRepository()))
                            .requirements(new Requirement("system.builder.command.Cygwinbatch"))))
            .linkedRepositories("TRYMEsecond")
            
            .triggers(new BitbucketServerTrigger())
            .planBranchManagement(new PlanBranchManagement()
                    .createForVcsBranch()
                    .delete(new BranchCleanup()
                        .whenRemovedFromRepositoryAfterDays(7)
                        .whenInactiveInRepositoryAfterDays(30))
                    .notificationForCommitters());
        return plan;
    }

On further examination I have found the the change detection code is exported to the "View plan as Java Specs" screen IF the Repository is a Plan Repository but NOT a Linked Repository.

Strangely, the Change Detection settings are honoured as part of the Linked Repository.

Atlassian has warned that the Plan Repositories are being deprecated soon and Bamboo will always default to a Linked Repository.

Is that feature available in any version (we are on 6.4.1)?

Will the ChangeDetection continue to work?

We used Linked Repositories because every solution had its own repo so any change triggered a build.

Now we are using mon-repos, we need specific paths to rigeer the Build Plan.

To summarise:

Plan using Linked Repository has this:

.linkedRepositories("Data.Core") 

Plan using Plan Repository has this:

 .planRepositories(new BitbucketServerRepository()
        .name("Data.Core")
        .oid(new BambooOid("***"))
        .repositoryViewer(new BitbucketServerRepositoryViewer())
        .server(new ApplicationLink()
    .name("***")
    .id("***"))
        .projectKey("LEG")
        .repositorySlug("data.core")
        .sshPublicKey("*")
        .sshPrivateKey("*
                  .sshCloneUrl("***")
        .changeDetection(new VcsChangeDetection()
    .filterFilePatternOption(VcsChangeDetection.FileFilteringOption.INCLUDE_ONLY)
    .filterFilePatternRegex("Includeme")))

And we cannot do this:

.linkedRepositories("Data.Core") 

    .changeDetection(new VcsChangeDetection()
    .filterFilePatternOption(VcsChangeDetection.FileFilteringOption.INCLUDE_ONLY)
    .filterFilePatternRegex("Includeme"))

It will be important for us to know where we are on this

Hi Terry,

You are correct, you need plan repositories for this.

At the moment of this message, we don't have plans to remove plan repositories. On recent Bamboo versions we have created mechanisms to encourage users to configure and convert plan repositories to linked ones. We understand that using linked repositories simplifies the server configuration, reduces the amount and complexity of DB data and also helps on updating repository details in just one place.

Is that feature available in any version (we are on 6.4.1)?

You should be able to use this plan repositories and update them through specs from your version to the latest version of Bamboo.

Will the ChangeDetection continue to work?

It works for newer version and AFAIK it will keep that way.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

190 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you