by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Austin Hacker
    @a-hacker
    I'm also trying to test out bitbucket server 6.8.0 but I'm getting issues with my local environment. I'll let you know if I find anything related to the latest release.
    cypher0n3
    @cypher0n3
    Well, I figured out what changed. Apparently now there's a dropdown to select the Jenkins server in the hooks settings that wasn't there before the upgrade, so I have to add that to all the hooks settings for all of my hooks for all of my repos. Fortunately I've scripted that out through the REST API
    syryin
    @syryin
    Hi,
    Hi @a-hacker , Thanks for the great plugin. We are using the version 3.2.9 (plugin) in BB data center version (5.16). We are planning to upgrade BB DC to version 6. Will this plugin works fine in data center version 6 ? or Do you have data center edition for this plugin. Thanks
    Austin Hacker
    @a-hacker
    Hey @syryin. Unfortunately the plugin has not been officially supported on Bitbucket data center since the version 6 major release. This was due to Atlassian changing the requirements for Data Center compatibility. I don't believe there is anything wrong with the plugin itself, I just don't have the time or resources to meet Atlassian's new requirements (such as having a data center cluster to test against). If you would like, I think you can install the plugin manually in your data center instance. While data center isn't officially supported, I'd be happy to help with errors you may run into.
    Reddysekhar Gaduputi
    @rgaduput
    Hi,
    i am new to this plugin, and trying to setup it in our org .
    we have different projects , multiple Jenkins server
    is it possible add all our Jenkins server for this plugin ? i have checked "Jenkins Settings" in "Administration" but it lets you add only one jenkins server and same at project context as well
    anything else i should look at ?
    image.png
    Austin Hacker
    @a-hacker
    Hi @rgaduput. Multiple Jenkins servers per project are not currently supported. I'm looking to add support for them but it is a slow process as a lot of the code needs to change to support this functionality.
    Reddysekhar Gaduputi
    @rgaduput
    ok, thank you @a-hacker
    Reddysekhar Gaduputi
    @rgaduput

    Hi @a-hacker ,
    Is some one working on adding this feature ParameterizedBuilds/parameterized-builds#134 ?
    If not, I would like to contribute towards it
    My idea is to add two fields in PUSH EVENT trigger (may be in others as well)
    1) Ignore Committers : List of usernames separated by comma (,) if event author is someone one from this list trigger will be ignored
    2) Ignore Commit Message : A string (example skipCI) configurable by user , if it found in the commit message trigger will be ignored

    What you think ?

    Austin Hacker
    @a-hacker
    No one is currently working on that so please feel free to take it on! Those both seem like good ideas. I particularly like the second idea. I think it would make sense to make the field a regex check like the branch filter.
    David Masters
    @davemasters1984_twitter
    Hello. I've been using this plugin for a while now and it's been great. However, I've recently decided to move to multi-branch pipelines and ran into a snag. It works as expected when I trigger the build manually using the dropdown within Bitbucket, but it doesn't trigger the build from pull request events such as "pr opened" or "pr source rescoped". Am I right in thinking that the trigger behaviour should be the same between these PR events and the manual event? As-in, it's only the ref & push events that cause a scan rather than a build? Is there any reason why the manual event triggers but the PR events don't? Thanks for any help!
    Austin Hacker
    @a-hacker
    @davemasters1984_twitter The current implementation only supports a single workflow where pipelines are created for branches and not PRs. Therefore the scan endpoint is called on ref change events (branch created or deleted and push events) while builds are triggered for PR events and the manual event. The job form should be different for pipeline jobs such that you fill out how your multi-branch pipeline is configured (i.e. when a scan should be performed) and just trigger a scan for all relevant events except for manual builds. I just haven't had the time/motivation to make that happen and probably won't in the foreseeable future. If you'd be interested in working on the change, I'd be happy to provide you with whatever assistance you may need.
    David Masters
    @davemasters1984_twitter
    @a-hacker thanks for the quick response! I have read through some of the issues around multi-branch and I understand it's not as flexible as some user's would like. However, reading the documentation it seems that it should work OK for my scenario. What I'm struggling with is why I'm not getting a build triggered when I open a new PR, but I am getting a build triggered from running it manually? As both of these actions should call the build endpoint, not the scan?
    Austin Hacker
    @a-hacker
    @davemasters1984_twitter I don't see anything in code that would cause this. Both manual and PR triggers execute the same functions and both should provide the necessary data to trigger a build. Could you open an issue for this?
    rhodessteve
    @rhodessteve
    Hi, I've recently taken over support for Bitbucket and this addon. There is a request to add a second jenkins server. From reading up here, i saw that there was no support for multiple jenkins servers. But what does "If you have multiple Jenkins servers setup you can set the api token for each one." mean? From: https://github.com/ParameterizedBuilds/parameterized-builds#link-your-bitbucket-server-account-to-jenkins
    Austin Hacker
    @a-hacker
    @rhodessteve You can't have more than one jenkins server per project but you can have different servers for each project. You can also set a global server.
    rhodessteve
    @rhodessteve
    @a-hacker and are there any further instructions for setting multiple API tokens for that? I am not very familiar with the addon. Where should this happen?
    David Masters
    @davemasters1984_twitter
    @a-hacker just to clarify something - would updating a pull request (i.e. pushing a commit) cause the PR Source Rescoped event to fire?
    NeoDobby
    @NeoDobby
    Hi, I have a problem triggering builds on a multibranch pipeline, and I'm not sure if this is a configuration issue on my side or a bug. The jenkins build is set up to not trigger builds on scans ("Suppress automatic SCM triggering"), so I want bitbucket to trigger the builds on specific branches directly. I have 3 triggers on my repo, one for manual, which works fine, the multibranch pipeline checkbox is not selected. The second trigger should trigger builds on feature and bugfix branches on a PUSH EVENT, so I have that trigger selected, and ref filter set to "feature/.|bugfix/.". No matter if I check multibranch trigger, the push event always just triggers a scan instead of a build on the branch. Same problem with the third trigger, on PR MERGED, it should trigger a build on PR destination "master|maintenance/.*", but again, it only triggers a scan instead of a build. If I understand the README correctly, the multibranch checkbox toggles scanning vs. direct build for REF CREATED, REF DELETED and PUSH EVENT, and all others should directly trigger a build. But it doesn't seem to work like that for me. Do you have any hints what could be wrong? (I'm using 4.0.12)
    David Masters
    @davemasters1984_twitter
    I might be wrong but I believe the checkbox simply allows the plugin to use the correct Jenkins URL to invoke the build; multibranch pipelines have a different URL structure than standard builds
    I think the plugin will always trigger a scan for the REF CREATED, REF DELETED and PUSH EVENT, but SHOULD trigger a build for the PR* and Manual events. However, I cannot get it to trigger a build for the PR* events
    NeoDobby
    @NeoDobby
    Thanks @davemasters1984_twitter . For me the manual trigger works no matter if I check the checkbox or not, so it doesn't look like it needs to change the build trigger URL for manual builds. Anyway, the README is not completely clear about how the checkbox is supposed to work.
    David Masters
    @davemasters1984_twitter
    @NeoDobby that's interesting. I just a manual build without the checkbox checked and I get a message saying "Job not found"
    NeoDobby
    @NeoDobby
    Correction, actually, without the checkbox the manual build just triggers a scan for me.
    NeoDobby
    @NeoDobby
    So I think you are right about the URLs - the URL for the scan is "job/MyJob/build" and for triggering a build it is "job/MyJob/job/master/build", which would explain why it triggers the scan without the checkbox and the build with the checkbox
    NeoDobby
    @NeoDobby
    And another correction: The PR MERGED trigger does nothing for me, it doesn't trigger a build, nor does it trigger a scan. Anyway if the trigger worked, would it trigger a branch on the source branch or on the destination branch?
    NeoDobby
    @NeoDobby
    Looks like it would trigger a build on the source branch, because for pipeline the value of $BRANCH is added, to the URL, which is the source branch of the PR (https://github.com/ParameterizedBuilds/parameterized-builds/blob/master/src/main/java/com/kylenicholls/stash/parameterizedbuilds/item/Job.java#L324). In my case, the source branch is deleted on merge, so that could be a problem, but Jenkins doesn't even try to build the source branch, so the trigger is not working at all.
    David Masters
    @davemasters1984_twitter
    @NeoDobby you have the same issue as me - the PR* events do nothing for me either

    @NeoDobby with regards to the correct branch - what I had hoped to do is to send both the source and target branches as parameters, and when those parameters are present, my pipeline would merge them locally before running the build. In your case you could send an extra parameter to your pipeline called something like "Merged=true" which your pipeline could respond to by checking out the target branch rather than the source.

    Having said that, I think just having a plain webhook to trigger scans on commits would probably be simpler? i.e. not use this plugin for the merge event?

    NeoDobby
    @NeoDobby
    @davemasters1984_twitter thanks for the suggestion, but a plain webhook is not enough because I need to decide if a branch should be built based on the trigger. I was able to make the push event trigger for certain branches work by suppressing the automatic SCM triggering conditionally, but I still need to somehow trigger a build on merge. I'll have to try to find a workaround for that.
    Austin Hacker
    @a-hacker
    @rhodessteve those API tokens are user-specific so they are only used when that specific user triggers a build. They are set in the user's bitbucket user settings. If you set a default user to trigger jobs with, you'll only need to set a single API token on the project or global jenkins settings page.
    @davemasters1984_twitter in regards to the PR Source Rescoped event, this happens whenever the source branch is updated as in the example you gave. However, if the target branch changes (choosing a different branch to merge into) that will not fire the event.
    Austin Hacker
    @a-hacker
    @NeoDobby , @davemasters1984_twitter what do the names of your pipelines look like? Do they match the branch names or do they use the PR id?
    David Masters
    @davemasters1984_twitter
    My branch is named feature/AC-2838-multi-branch-pipeline and the URL for it's job in Jenkins is job/XXX_XXX/job/feature%252FAC-2838-multi-branch-pipeline
    If I replace the %252F in URL with a /then I get a 404. So if the plugin is not URL encoding the branch name on the URL that could explain why it's not working; but the problem with that theory is that it works OK for the manual trigger.
    David Masters
    @davemasters1984_twitter

    After spending some more time looking into it, I've discovered the following:

    • In order for builds to be triggered from PR events, Jenkins needs to already be aware of the branch for the PR.

    • You can make Jenkins aware of the branch before the PR is created in two different ways:

      1) By enabling the ref_created triggers in the Bitbucket plugin - this will cause a scan when branches are created.
      2) Set Jenkins to poll every X minute to look for branches/changes

    • Both of these will trigger a build for the feature branch, without any pull request params.

    • When you run a build manually from a PR, despite Jenkins seemingly not yet knowing about the branch from a scan, it will run the build with any PR parameters fine.

    • Jenkins builds will only be triggered on a multibranch pipeline from a PR event IF the branch name does not contain a slash in it; i.e. feature/myfeature. I presume there is an issue in code with URL encoding, as jenkins expects %252F in the URL instead of a \

    David Masters
    @davemasters1984_twitter

    I wonder if this line in the method Job.createPipelineJobPath should change from:

    jobSegments.add(variables.fetch("$BRANCH"));

    to:

    jobSegments.add(URLEncoder.encode(variables.fetch("$BRANCH"), "UTF-8"));

    Austin Hacker
    @a-hacker
    That seems likely. I'll try to reproduce this locally and make sure that fixes the issue
    David Masters
    @davemasters1984_twitter
    I would raise a PR, but the trouble is I'm not a Java dev, and it would take me an age to get env setup etc
    having said the above, I'm still really confused as to why it seems to work for the manual event.... even with / in my branch name
    Austin Hacker
    @a-hacker
    No worries. Getting the right environment setup for this can be a bit of a pain.
    Austin Hacker
    @a-hacker
    For the record, the manual trigger worked because the branch name was already encoded when the front-end code sends the trigger through a REST endpoint. PR for the fix is here: ParameterizedBuilds/parameterized-builds#279
    David Masters
    @davemasters1984_twitter
    @a-hacker awesome - thanks for making the change! Ah, that explains it :)
    LoriGelbein
    @LoriGelbein
    I am new and I am supporting the Parameterized-builds plugin with Bitbucket. We have a change to the Jenkins Base URL going in. In my testing in Dev when I change the BASE URL in the Bitbucket Admin and select Save, refresh the screen the change is not saved. We are using the following versions of the Plug-in Dev = 4.0.9, Prod=4.0.2 Bitbucket Server Version = 6.1.2. Thank you in advance for any assistance or guidance on this item
    nedmark
    @nedmark
    Hi All, we are using this plugin version 4.011 on the bitbucket version 6.6.0. It is not possible to update or to uninstall this addon. Thank you in advance for your help.
    Austin Hacker
    @a-hacker
    @nedmark that sounds like a Bitbucket issue. You should consider opening a support ticket with Atlassian.
    @LoriGelbein I can't replicate that issue. You may want to consider updating to version 4.0.13. It could be an old issue that has since been resolved.
    syryin
    @syryin
    Hi @a-hacker , Did you get chance to update the plugin to data center compatible? Any estimated time of completion. Thanks
    Austin Hacker
    @a-hacker
    @syryin No. At this point the plugin will not be officially marked as data center compatible. I do not have the resources or motivation to make it happen. I haven't tested it but you may be able to manually install the plugin in a Bitbucket data center instance.
    Rakshatha Shetty
    @RakshathaShetty_gitlab
    Hi All, In bitbucket repository we are using hook "Parameterized Builds for Jenkins". We are running the Jenkins build by selecting "Build in Jenkins" option from bitbucket. During this a pop-up appears in Bitbucket quoting "Optional: You can link your Jenkins account to your Bitbucket account.".
    Clicking on this takes us to page https://bitbucket.com/plugins/servlet/account/jenkins which is an incorrect URL.
    The correct URL is https://bitbucket.com/plugins/servlet/jenkins/account
    Could this be config issue?