Skip to content

codacy-acme/disable-local-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disable Build Server Analysis for Codacy Repositories

This script allows you to disable the build server analysis setting for multiple repositories in your Codacy organization.

Features

  • Retrieves all repositories from your Codacy organization
  • Allows you to select specific repositories or all repositories to update
  • Attempts to disable build server analysis for selected repositories
  • Provides detailed logging and a summary report

Requirements

  • Python 3.6 or higher
  • Required Python packages:
    • requests
    • python-dotenv

Installation

  1. Clone this repository or download the files
  2. Install the required packages:
pip install -r requirements.txt
  1. Copy the .env.template file to .env:
cp .env.template .env
  1. Edit the .env file and fill in your Codacy API token, Git provider, and organization name

Project Structure

  • disable_build_analysis.py: Main script
  • .env.template: Template for environment variables
  • .env: Your actual credentials (gitignored)
  • requirements.txt: Required Python packages
  • .gitignore: Prevents sensitive and generated files from being committed
  • logs/: Directory for log files (gitignored)

Usage

Run the script:

python disable_build_analysis.py

The script will:

  1. Fetch all repositories from your Codacy organization
  2. Display a list of all repositories
  3. Prompt you to select which repositories to update
  4. Attempt to disable build server analysis for the selected repositories
  5. Display a summary report of the results

Selection Options

When prompted to select repositories, you can:

  • Enter specific repository numbers separated by commas (e.g., 1,3,5)
  • Enter a range of repository numbers (e.g., 1-5)
  • Enter all to select all repositories

Logging

The script creates detailed logs in the logs directory. Each run creates a new log file with a timestamp in the filename.

API Endpoints Used

  • List repositories: GET /organizations/{provider}/{remoteOrganizationName}/repositories
  • Get build server analysis setting: GET /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis
  • Update build server analysis setting: PATCH /organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/analysis

About

Script to Disable build on local server for Codacy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages