Skip to content

Horreum API Integration Script for Performance Test#160

Merged
jhutar merged 1 commit into
redhat-performance:mainfrom
yogananth-subramanian:horreum-api
Sep 30, 2025
Merged

Horreum API Integration Script for Performance Test#160
jhutar merged 1 commit into
redhat-performance:mainfrom
yogananth-subramanian:horreum-api

Conversation

@yogananth-subramanian
Copy link
Copy Markdown
Contributor

@yogananth-subramanian yogananth-subramanian commented Aug 19, 2025

This script creates a comprehensive Horreum test and schema setup forperformance monitoring. It uses configuration-driven field definitions from horreum_fields_config.yaml and creates labels, change detection variables, and proper grouping for performance regression monitoring.

Features:

  • Loads field definitions from horreum_fields_config.yaml
  • Creates Horreum test and schema from configuration
  • Creates labels with intelligent naming (camelCase + __ prefix)
  • Prevents duplicate labels and variables
  • Optional cleanup of obsolete labels and variables
  • Dry-run mode for safe preview of all operations including cleanup
  • Provides detailed status reporting
  • Fully automated operation (no user prompts)

Authentication:
API Key (Recommended):
export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"

Token (Legacy):
    export HORREUM_TOKEN="your-bearer-token"

Configuration:
Test and schema definitions are loaded from horreum_fields_config.yaml:
- test: Test configuration (name, owner, description, etc.)
- schema: Schema configuration (name, URI, owner, etc.)
- fields: Field definitions with change detection settings

Environment Variables:
Required:
HORREUM_URL - Horreum instance URL
HORREUM_API_KEY - API key for authentication

Optional:
    HORREUM_SCHEMA_ID        - Use existing schema ID (skip creation)
    HORREUM_TEST_ID          - Use existing test ID (skip creation)
    SKIP_LABELS=true         - Skip label creation
    CLEANUP_LABELS=false     - Disable removal of obsolete labels (default: enabled)
    CLEANUP_VARIABLES=false  - Disable removal of obsolete variables (default: enabled)
    DRY_RUN=false           - Execute changes (default: dry run enabled)

Usage:
# Basic usage
export HORREUM_URL="http://your-horreum-instance:8080"
export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"
python3 horreum_api.py

# Execute changes (disable dry-run mode)
export DRY_RUN=false
python3 horreum_api.py

# Disable cleanup operations
export CLEANUP_LABELS=false
export CLEANUP_VARIABLES=false
python3 horreum_api.py

# Using existing resources
export HORREUM_SCHEMA_ID=285
export HORREUM_TEST_ID=399
python3 horreum_api.py

# Force execution without dry run (use with caution)
export DRY_RUN=false
python3 horreum_api.py

Assisted-by: AI

@jhutar
Copy link
Copy Markdown
Contributor

jhutar commented Aug 19, 2025

Nice @yogananth-subramanian ! Could you please fix linting issues?

@yogananth-subramanian yogananth-subramanian force-pushed the horreum-api branch 2 times, most recently from fe710ba to ffc40c7 Compare September 4, 2025 18:46
@yogananth-subramanian yogananth-subramanian force-pushed the horreum-api branch 5 times, most recently from fb6a1f3 to c82f957 Compare September 30, 2025 07:24
@jhutar
Copy link
Copy Markdown
Contributor

jhutar commented Sep 30, 2025

Thank you Yogi!

…performance monitoring. It uses configuration-driven field definitions from horreum_fields_config.yaml and creates labels, change detection variables, and proper grouping for performance regression monitoring.

Horreum API Integration Script for Performance Test

This script creates a comprehensive Horreum test and schema setup for performance monitoring.
It uses configuration-driven field definitions from a YAML configuration file and creates labels,
change detection variables, and proper grouping for performance regression monitoring.

Features:
- Loads field definitions from configurable YAML file (default: horreum_fields_config.yaml)
- Creates Horreum test and schema from configuration
- Creates labels with intelligent naming (camelCase + __ prefix)
- Creates change detection variables with smart grouping
- Prevents duplicate labels and variables
- Optional cleanup of obsolete labels and variables
- Dry-run mode for safe preview of all operations including cleanup
- Provides detailed status reporting
- Fully automated operation (no user prompts)
- Flexible configuration file input via command line or environment variable

Authentication:
    API Key (Recommended):
        export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"

    Token (Legacy):
        export HORREUM_TOKEN="your-bearer-token"

Configuration:
    Test and schema definitions are loaded from a YAML configuration file:
    - test: Test configuration (name, owner, description, etc.)
    - schema: Schema configuration (name, URI, owner, etc.)
    - fields: Field definitions with change detection settings
    Default configuration file: horreum_fields_config.yaml

Environment Variables:
    Required:
        HORREUM_URL              - Horreum instance URL
        HORREUM_API_KEY          - API key for authentication

    Optional:
        HORREUM_CONFIG_FILE      - Path to configuration file (default: horreum_fields_config.yaml)
        HORREUM_SCHEMA_ID        - Use existing schema ID (skip creation)
        HORREUM_TEST_ID          - Use existing test ID (skip creation)
        SKIP_LABELS=true         - Skip label creation
        CLEANUP_LABELS=false     - Disable removal of obsolete labels (default: enabled)
        CLEANUP_VARIABLES=false  - Disable removal of obsolete variables (default: enabled)
        DRY_RUN=false           - Execute changes (default: dry run enabled)

Command Line Arguments:
    --config-file, -c           - Path to configuration file (overrides HORREUM_CONFIG_FILE)

Usage:
    # Basic usage (uses horreum_fields_config.yaml)
    export HORREUM_URL="http://your-horreum-instance:8080"
    export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"
    python3 horreum_api_example.py

    # Using custom config file via command line
    python3 horreum_api_example.py --config-file my_config.yaml

    # Using custom config file via environment variable
    export HORREUM_CONFIG_FILE="my_config.yaml"
    python3 horreum_api_example.py

    # Execute changes (disable dry-run mode)
    export DRY_RUN=false
    python3 horreum_api_example.py

    # Disable cleanup operations
    export CLEANUP_LABELS=false
    export CLEANUP_VARIABLES=false
    python3 horreum_api_example.py

    # Using existing resources
    export HORREUM_SCHEMA_ID=285
    export HORREUM_TEST_ID=399
    python3 horreum_api_example.py

    # Force execution without dry run (use with caution)
    export DRY_RUN=false
    python3 horreum_api_example.py

Assisted-by: AI
@jhutar jhutar merged commit 25822db into redhat-performance:main Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants