create-qa-architect 5.13.5 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,11 @@ const path = require('path')
12
12
  const { execSync } = require('child_process')
13
13
  const yaml = require('js-yaml')
14
14
  const { showProgress } = require('../ui-helpers')
15
- const { hasFeature, showUpgradeMessage } = require('../licensing')
15
+ const {
16
+ hasFeature,
17
+ showUpgradeMessage,
18
+ ensureLicenseFresh,
19
+ } = require('../licensing')
16
20
 
17
21
  const DAYS_PER_MONTH = 30
18
22
  const DEFAULT_PULL_REQUEST_FACTOR = 0.8
@@ -771,20 +775,26 @@ function generateReport(analysis) {
771
775
  }
772
776
 
773
777
  /**
774
- * Main handler for --analyze-ci command
778
+ * Main handler for --analyze-ci command. When `options.doctor` is true,
779
+ * appends the CI Doctor diagnostics (flaky tests, duplicated jobs, etc.)
775
780
  */
776
- async function handleAnalyzeCi() {
781
+ async function handleAnalyzeCi(options = {}) {
777
782
  const projectPath = process.cwd()
778
783
 
784
+ await ensureLicenseFresh()
779
785
  if (!hasFeature('ciCostAnalysis')) {
780
786
  showUpgradeMessage('GitHub Actions cost analysis')
781
787
  process.exit(1)
782
788
  }
783
789
 
790
+ if (options.doctor && !hasFeature('ciDoctor')) {
791
+ showUpgradeMessage('CI Doctor (workflow health + flaky test detection)')
792
+ process.exit(1)
793
+ }
794
+
784
795
  const spinner = showProgress('Analyzing GitHub Actions workflows...')
785
796
 
786
797
  try {
787
- // Step 1: Discover workflows
788
798
  const workflowFiles = discoverWorkflows(projectPath)
789
799
 
790
800
  if (workflowFiles.length === 0) {
@@ -796,7 +806,6 @@ async function handleAnalyzeCi() {
796
806
  process.exit(1)
797
807
  }
798
808
 
799
- // Step 2: Parse and analyze workflows
800
809
  const workflows = []
801
810
  for (const wf of workflowFiles) {
802
811
  try {
@@ -815,13 +824,8 @@ async function handleAnalyzeCi() {
815
824
  }
816
825
  }
817
826
 
818
- // Step 3: Get commit frequency
819
827
  const commitStats = getCommitFrequency(projectPath)
820
-
821
- // Step 4: Calculate costs
822
828
  const costs = calculateMonthlyCosts(workflows, commitStats.commitsPerDay)
823
-
824
- // Step 5: Analyze optimization opportunities
825
829
  const optimizations = analyzeOptimizations(
826
830
  workflows,
827
831
  commitStats.commitsPerDay
@@ -829,7 +833,6 @@ async function handleAnalyzeCi() {
829
833
 
830
834
  spinner.succeed('Analysis complete')
831
835
 
832
- // Step 6: Generate report
833
836
  generateReport({
834
837
  workflows,
835
838
  costs,
@@ -837,6 +840,12 @@ async function handleAnalyzeCi() {
837
840
  optimizations,
838
841
  })
839
842
 
843
+ if (options.doctor) {
844
+ const { runDoctorChecks, buildDoctorReport } = require('./ci-doctor')
845
+ const findings = runDoctorChecks(workflows, projectPath, options)
846
+ process.stdout.write(buildDoctorReport(findings))
847
+ }
848
+
840
849
  process.exit(0)
841
850
  } catch (error) {
842
851
  spinner.fail('Analysis failed')