Add instrumentation for inputs keyword usage tracking

What does this MR do and why?

  • Add instrumentation for inputs keyword usage tracking
  • Add tracking for the 'inputs:' keyword in pipeline configs and sets ups header level foundational instrumentation.

Validation Steps

  1. Test basic inputs tracking:

    • Create a test project
    • Add this .gitlab-ci.yml:
      spec:
        inputs:
          environment:
            default: 'staging'
      ---
      test_job:
        script: echo "Environment is $[[ inputs.environment ]]"
    • Push and run pipeline
    • Check Rails console: Gitlab::InternalEvents.track_event('use_inputs_keyword_in_cicd_yaml', project: Project.find(PROJECT_ID))
    • Verify event was recorded in events table
  2. Test input rules tracking:

    • Update .gitlab-ci.yml to:
      spec:
        inputs:
          environment:
            rules:
              - if: '$CI_COMMIT_REF_NAME == "main"'
                default: 'production'
              - default: 'staging'
      ---
      test_job:
        script: echo "Environment is $[[ inputs.environment ]]"
    • Push and run pipeline
    • Verify use_input_rules_keyword_in_cicd_yaml event was recorded
  3. Test no false positives:

    • Create pipeline with regular .gitlab-ci.yml (no spec/inputs)
    • Verify neither event is tracked
    • Create pipeline with spec: but no inputs:
    • Verify neither event is tracked

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Laura Montemayor

Merge request reports

Loading