hygieia / hygieia-scm-bitbucket-collector

Hygieia Collector for BitBucket
https://github.com/capitalone/Hygieia/blob/gh-pages/pages/hygieia/collectors/scm/bitbucket.md
Apache License 2.0
1 stars 22 forks source link

No data collected by collector : Repo Count 0 0s #28

Open richardmendonca7 opened 3 years ago

richardmendonca7 commented 3 years ago

Hi ,

Unable to get any data using bitbucket collector , image

Property file

Database Name

dbname=dashboarddb

    # Database HostName - default is localhost
    dbhost=localhost

    # Database Port - default is 27017
    dbport=27017

    # MongoDB replicaset
    dbreplicaset=[false if you are not using MongoDB replicaset]
    dbhostport=[host1:port1,host2:port2,host3:port3]

    # Database Username - default is blank
    dbusername=userdash

    # Database Password - default is blank
    dbpassword=dashboardpass

    # Logging File location
    logging.file=./logs/bitbucket.log

    # Collector schedule (required)
    git.cron=0 0/1 * * * *

    # Mandatory parameters (comma separated, if multiple)
    git.host=https://bitbucket.**************.com/

    #If using Bitbucket Cloud then go for below parameter for git.host
    #git.host=api.bitbucket.org/

    git.username=********************

    #convert password to base64
    git.password=************

    #Since the older api version is now depreciated so current api is given below for Bitbucket Cloud
    #(REF:https://confluence.atlassian.com/bitbucket/rest-apis-222724129.html)
    git.api=/api/2.0/repositories/

    # Maximum number of days to go back in time when fetching commits
    git.commitThresholdDays=15

    # Page size for rest calls
    #   Only applicable to Bitbucket Server.
    #   Only applicable to Bitbucket Cloud.
    git.pageSize=25

    # Bitbucket product
    #   Set to 'cloud' to use Bitbucket Cloud (formerly known as Bitbucket)
    #   Set to 'server' to use Bitbucket Server (formerly known as Stash)
    #   More information can be found here: 
        https://github.com/capitalone/Hygieia/issues/609
    git.product=server

    # Bitbucket key for private repos
    bitbucket.key=*******************

command for running collector : java -jar bitbucket-scm-collector.jar --spring.config.name=git --spring.config.location=/root/hygieia_new/collector/hygieia-scm-bitbucket-collector/application.properties

Widget : image

gwesterfieldjr commented 3 years ago

I have the same issue. Looks like the collector looks for the repo/branch info in mongo component collection which I assume should be getting updated by they UI when you save in the widget. I checked mongo and looks like the UI is never saving the data to mongo so when to collector runs it does not have the info required to collect from bitbucket.

ameykamat05 commented 3 years ago

I have same issue. The issue is due to bug in API code. issue is API is not storing the widget details in MongoDB (under components table for type SCM". If I manually make entries in mongoDB, collector fetches the repo details, and the UI shows all the details on dashboard.