Skip to content

Latest commit

 

History

History
60 lines (36 loc) · 3.07 KB

howto-create-campaign.md

File metadata and controls

60 lines (36 loc) · 3.07 KB

How To Run A Campaign

Here are some minimal steps to set up a new Bug Bash Campaign.

  1. Create a new Campaign record:

    curl -u "theAdminUsername:theAdminPassword" -X PUT http://localhost:7777/admin/campaign/add/myCampaignName -d '{ "startOn": "2021-03-10T12:00:00.000Z", "endOn": "2022-03-15T12:00:00.000Z"}'
    

    Be sure you use a startOn and endOn date that is before today, and after today, otherwise the campaign will not be "active". Use the command below to verify your new campaign appears in the list of "active" campaigns:

    curl http://localhost:7777/campaign/active
    
  2. Add the organization that owns the repository that will be having a bug bash. (For personal repositories, the "organization" will just be your GitHub username.)

    curl -u "theAdminUsername:theAdminPassword" -X PUT http://localhost:7777/admin/organization/add -d '{ "scpName": "GitHub", "organization": "my-organization"}'
    
  3. Add at least one participant (e.g. a GitHub user) who will be submitting bug fixes (PRs) during this campaign:

    curl -u "theAdminUsername:theAdminPassword" -X PUT http://localhost:7777/admin/participant/add -d '{ "scpName": "GitHub", "campaignName": "myCampaignName", "loginName": "mygithubid"}'
    

    Before going much further, you should ensure Sonatype Lift is configured for your GitHub repository.

    To verify things are working, have the GitHub user (mygithubid in this example) generate a Pull Request against a repository owned by the organization we added (my-organization in this example). Once the PR is created, you should see Lift performing an analysis of the PR, similar to this: Lift Analysing

  4. To view the current scores for your Bug Bash, open a browser to: http://localhost:7777/index.html

Miscellaneous Tidbits

  • You can update an existing Campaign (e.g. myCampaignName) with new "start" and "end" dates using the command below:

     curl -u "theAdminUsername:theAdminPassword" -X PUT http://localhost:7777/admin/campaign/update/myCampaignName -d '{ "startOn": "2022-04-15T12:00:00Z", "endOn": "2022-04-30T12:00:00Z"}'
    
  • List Active Campaigns using the command below. This includes only those campaigns with an end date that is after today.

     curl http://localhost:7777/campaign/active