@freshworks/shiftleft-tools 1.1.21 → 1.1.23

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freshworks/shiftleft-tools",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "CLI for managing Cursor rules/skills and Postman test infrastructure across Java Spring Boot and Node.js/Express projects",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -7,6 +7,7 @@ A publish failure logs a warning and never fails the build.
7
7
 
8
8
  import os
9
9
  import re
10
+ from decimal import Decimal
10
11
 
11
12
 
12
13
  def _normalize_repo(url):
@@ -69,14 +70,14 @@ def build_row(metrics, meta):
69
70
 
70
71
  # --- coverage (API coverage) ---
71
72
  if api_coverage:
72
- cov_pct = float(api_coverage.get('coverage_percent', 0))
73
- well_pct = float(api_coverage.get('well_tested_percent', 0))
74
- qp_pct = float(api_coverage.get('query_params_percent', 0))
73
+ cov_pct = Decimal(str(api_coverage.get('coverage_percent', 0)))
74
+ well_pct = Decimal(str(api_coverage.get('well_tested_percent', 0)))
75
+ qp_pct = Decimal(str(api_coverage.get('query_params_percent', 0)))
75
76
  skipped = int(api_coverage.get('skipped_tests', 0))
76
77
  gaps = (api_coverage.get('gaps') or [])[:25]
77
78
  by_method = api_coverage.get('by_method') or {}
78
79
  else:
79
- cov_pct = well_pct = qp_pct = 0.0
80
+ cov_pct = well_pct = qp_pct = Decimal('0')
80
81
  skipped = 0
81
82
  gaps = []
82
83
  by_method = {}
@@ -100,7 +101,7 @@ def build_row(metrics, meta):
100
101
  timeout = int(mutation.get('timeout', 0))
101
102
  total = int(mutation.get('total', 0))
102
103
  denominator = killed + survived + no_cov
103
- score = round((killed / denominator * 100), 2) if denominator > 0 else 0.0
104
+ score = Decimal(str(round((killed / denominator * 100), 2))) if denominator > 0 else Decimal('0')
104
105
  mut_row = {
105
106
  'tool': meta.get('mutation_tool', 'pit'),
106
107
  'killed': killed,
@@ -170,7 +171,7 @@ def publish(row):
170
171
  return
171
172
  try:
172
173
  import boto3
173
- dynamodb = boto3.resource('dynamodb')
174
+ dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
174
175
  table = dynamodb.Table(table_name)
175
176
  table.put_item(Item=row)
176
177
  print(f'[publish_health] Published health row: {row["Repo"]} @ {row["DateTime"]}')