Skip to content

[ DOCs] Add missing docstrings across codebase#380

Merged
cshiels-ie merged 3 commits intoansible:develfrom
cshiels-ie:Docstring-update
Apr 29, 2026
Merged

[ DOCs] Add missing docstrings across codebase#380
cshiels-ie merged 3 commits intoansible:develfrom
cshiels-ie:Docstring-update

Conversation

@cshiels-ie
Copy link
Copy Markdown
Contributor

@cshiels-ie cshiels-ie commented Apr 27, 2026

Summary

  • Audited 276 Python source files for missing docstrings
  • 86 files changed, ~370+ Google-style docstrings added across modules, classes, functions, and methods
  • Zero logic changes — docstrings only
  • Areas covered: anonymized_rollups, automation_controller_billing, base, library, management, test utilities, exceptions, logger

Test plan

  • Verify no logic changes were introduced (diff review)
  • Confirm pre-commit hooks (ruff check/format) still pass

🤖 Generated with Claude Code


Note

Medium Risk
Mostly documentation-only, but it also tightens date_where input validation (type + timezone-awareness) and adjusts collection/role regex matching to avoid potential ReDoS, which could surface new runtime errors or change parsing behavior.

Overview
Adds extensive module/class/function docstrings across the anonymized_rollups, billing (automation_controller_billing), library, management commands, and test utilities to improve API clarity.

Non-doc changes include stricter validation in library/collectors/util.py:date_where (raises on non-datetime or timezone-naive bounds), a safer collection-name regex in library/dataframes/main_jobevent.py to prevent catastrophic backtracking, and minor public-API polish like explicit __all__ exports in anonymized_rollups/__init__.py.

Reviewed by Cursor Bugbot for commit e6eb6ed. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

📝 Walkthrough

Walkthrough

This pull request adds comprehensive documentation across the codebase and introduces configurable ID-range batching and time-window interval functionality for collectors. Key functional changes include a new get_gather_interval_hours() utility, batching infrastructure in output adapters, and updates to multiple collectors to support batched data extraction. Two new environment variables (METRICS_UTILITY_GATHER_BATCH_SIZE and METRICS_UTILITY_GATHER_INTERVAL_HOURS) are documented.

Changes

Cohort / File(s) Summary
Environment & Documentation
docs/environment.md
Added documentation for two new environment variables: METRICS_UTILITY_GATHER_BATCH_SIZE (row-count batching for COPY queries) and METRICS_UTILITY_GATHER_INTERVAL_HOURS (time-window sizing for gather slices, default 24 hours).
Base Utilities & Batching Infrastructure
metrics_utility/base/utils.py, metrics_utility/library/collectors/util.py
Added new get_gather_interval_hours() function with error handling. Introduced get_batch_size() function and batch SQL methods (DataframeOutput.batch_sql, CollectionOutput.batch_sql) with supporting _batch_copy_table_files helper for paginated ID-range extraction and CSV/DataFrame handling.
Billing Collectors - Slicing & Configuration
metrics_utility/automation_controller_billing/collectors.py
Refactored daily_slicing to generate time-window slices sized by get_gather_interval_hours() while enforcing midnight boundaries. Removed initial partial-day logic; added docstrings to daily_slicing and until_slicing documenting slicing semantics.
Controller Collectors - Batching Integration
metrics_utility/library/collectors/controller/job_host_summary.py, metrics_utility/library/collectors/controller/job_host_summary_service.py, metrics_utility/library/collectors/controller/main_host.py, metrics_utility/library/collectors/controller/main_indirectmanagednodeaudit.py, metrics_utility/library/collectors/controller/main_jobevent.py, metrics_utility/library/collectors/controller/unified_jobs.py
Refactored to support optional ID-range batching via get_batch_size(). Each collector now builds queries dynamically with conditional batch_filter, computes MIN(id), MAX(id) bounds when batching is enabled, and uses output.batch_sql for paginated execution; otherwise executes single output.sql query. Added comprehensive docstrings.
Other Collectors & Utilities - Documentation
metrics_utility/library/collectors/controller/config.py, metrics_utility/library/collectors/controller/config_django.py, metrics_utility/library/collectors/controller/credentials_service.py, metrics_utility/library/collectors/controller/execution_environments.py, metrics_utility/library/collectors/others/total_workers_vcpu.py
Added module and function docstrings documenting collector purpose, parameters, return types, and time-window filtering behavior. No logic changes.
Anonymized Rollups - Documentation
metrics_utility/anonymized_rollups/__init__.py, metrics_utility/anonymized_rollups/anonymized_rollups.py, metrics_utility/anonymized_rollups/base_anonymized_rollup.py, metrics_utility/anonymized_rollups/controller_version_anonymized_rollup.py, metrics_utility/anonymized_rollups/credentials_anonymized_rollup.py, metrics_utility/anonymized_rollups/events_modules_anonymized_rollup.py, metrics_utility/anonymized_rollups/execution_environments_anonymized_rollup.py, metrics_utility/anonymized_rollups/jobhostsummary_anonymized_rollup.py, metrics_utility/anonymized_rollups/jobs_anonymized_rollup.py, metrics_utility/anonymized_rollups/table_metadata_anonymized_rollup.py
Added module docstrings, class docstrings, and method docstrings across all rollup implementations describing aggregation behavior and expected output structures. No logic changes.
Billing Infrastructure - Extraction, Base Classes & Documentation
metrics_utility/automation_controller_billing/base/s3_handler.py, metrics_utility/automation_controller_billing/collector.py, metrics_utility/automation_controller_billing/extract/base.py, metrics_utility/automation_controller_billing/extract/extractor_controller_db.py, metrics_utility/automation_controller_billing/extract/extractor_directory.py, metrics_utility/automation_controller_billing/extract/extractor_s3.py, metrics_utility/automation_controller_billing/extract/factory.py
Added comprehensive module, class, and method docstrings describing extraction logic, S3 operations, tarball processing, and factory behavior. No logic changes.
Billing Infrastructure - DataFrames & Deduplication
metrics_utility/automation_controller_billing/dataframe_engine/base.py, metrics_utility/automation_controller_billing/dataframe_engine/dataframe_collection_status.py, metrics_utility/automation_controller_billing/dataframe_engine/dataframe_content_usage.py, metrics_utility/automation_controller_billing/dataframe_engine/dataframe_inventory_scope.py, metrics_utility/automation_controller_billing/dataframe_engine/dataframe_jobhost_summary_usage.py, metrics_utility/automation_controller_billing/dataframe_engine/db_dataframe_host_metric.py, metrics_utility/automation_controller_billing/dataframe_engine/factory.py, metrics_utility/automation_controller_billing/dedup/ccsp.py, metrics_utility/automation_controller_billing/dedup/factory.py, metrics_utility/automation_controller_billing/dedup/renewal_guidance.py
Added extensive docstrings for dataframe engines, deduplication implementations, and factory patterns describing input/output contracts, aggregation semantics, and deduplication logic. No functional changes.
Billing Infrastructure - Packages & Reporting
metrics_utility/automation_controller_billing/helpers.py, metrics_utility/automation_controller_billing/package/factory.py, metrics_utility/automation_controller_billing/package/package_crc.py, metrics_utility/automation_controller_billing/package/package_directory.py, metrics_utility/automation_controller_billing/package/package_s3.py, metrics_utility/automation_controller_billing/report/base.py, metrics_utility/automation_controller_billing/report/factory.py, metrics_utility/automation_controller_billing/report/report_ccsp.py, metrics_utility/automation_controller_billing/report/report_ccsp_v2.py, metrics_utility/automation_controller_billing/report/report_renewal_guidance.py, metrics_utility/automation_controller_billing/report_saver/factory.py, metrics_utility/automation_controller_billing/report_saver/report_saver_directory.py, metrics_utility/automation_controller_billing/report_saver/report_saver_s3.py
Added module, class, and method docstrings for helpers, packaging, report generation, and report-saving logic. Documents JSON merge behavior, CRC ingress flow, XLSX workbook structures, and S3/directory saving. No logic changes.
Library - Dataframes & Storage
metrics_utility/library/dataframes/base_dataframe.py, metrics_utility/library/dataframes/base_traditional.py, metrics_utility/library/dataframes/data_collection_status.py, metrics_utility/library/dataframes/host_metric.py, metrics_utility/library/dataframes/job_host_summary.py, metrics_utility/library/dataframes/main_host.py, metrics_utility/library/dataframes/main_jobevent.py, metrics_utility/library/storage/crc.py, metrics_utility/library/storage/directory.py, metrics_utility/library/storage/s3.py, metrics_utility/library/storage/segment.py, metrics_utility/library/storage/util.py
Added comprehensive docstrings for dataframe classes and storage backends describing CSV/JSON/Parquet I/O, aggregation/merge semantics, timestamp handling, and storage adapter behavior. No logic changes.
Library - Utilities & Core
metrics_utility/library/debug.py, metrics_utility/library/extractors.py, metrics_utility/library/instants.py, metrics_utility/library/lock.py, metrics_utility/library/package.py, metrics_utility/library/reports.py, metrics_utility/library/utils.py, metrics_utility/exceptions.py, metrics_utility/logger.py, metrics_utility/metric_utils.py
Added module and function docstrings describing utility and helper functionality including debug logging, tarball extraction, timezone-aware datetime handling, PostgreSQL advisory locks, and exception types. No logic changes.
Management & Commands
metrics_utility/management/commands/build_report.py, metrics_utility/management/commands/gather_automation_controller_billing_data.py, metrics_utility/management/validation.py, metrics_utility/management_utility.py
Added comprehensive docstrings for management commands and validation helpers describing option handling, error conditions, and validation semantics. No logic changes.
Test Utilities & Fixtures
metrics_utility/test/base/classes/analytics_collector.py, metrics_utility/test/base/classes/package.py, metrics_utility/test/base/functional/helpers.py, metrics_utility/test/conftest.py, metrics_utility/test/util.py
Added module, class, and function docstrings for test fixtures, assertion helpers, and utility functions. Docstrings for validation helpers expanded to detail parameter expectations and assertion behavior. No logic changes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR description is mostly complete but lacks mandatory Testing and Required Actions sections specified in the template. Add Testing section with Prerequisites, Steps to Test, and Expected Results. Complete Required Actions checklist with relevant items checked or marked N/A. Include Self-Review Checklist confirmation.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 91.06% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding missing docstrings across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread metrics_utility/library/collectors/controller/main_jobevent.py Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
metrics_utility/automation_controller_billing/collectors.py (1)

73-91: ⚠️ Potential issue | 🟠 Major

Guard against non-positive METRICS_UTILITY_GATHER_INTERVAL_HOURS to avoid an infinite loop.

get_gather_interval_hours() only validates that the env var parses to an int — it does not reject 0 or negative values. If a user sets METRICS_UTILITY_GATHER_INTERVAL_HOURS=0, then interval is timedelta(0), so end = min(start + interval, day_end, until) = start whenever start < day_end and start < until, and the next iteration sets start = end. The while start < until: loop will never terminate, hanging the gather command.

Either validate the value at parse time or guard here.

🛡️ Suggested guard at parse time (in `metrics_utility/base/utils.py`)
def get_gather_interval_hours():
    try:
        value = int(os.getenv('METRICS_UTILITY_GATHER_INTERVAL_HOURS', '24'))
    except (ValueError, TypeError):
        logger.error('METRICS_UTILITY_GATHER_INTERVAL_HOURS cannot be converted to an integer')
        raise
    if value <= 0:
        raise ValueError(f'METRICS_UTILITY_GATHER_INTERVAL_HOURS must be > 0, got {value}')
    return value
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@metrics_utility/automation_controller_billing/collectors.py` around lines 73
- 91, The loop in collectors.py can hang when get_gather_interval_hours()
returns 0 or negative, because interval = timedelta(hours=...) could be zero;
guard against this by validating the parsed value either where it’s read
(get_gather_interval_hours in metrics_utility/base/utils.py) or immediately
before using it in collectors.py: ensure the returned integer is > 0 and
raise/log a clear error (including METRICS_UTILITY_GATHER_INTERVAL_HOURS and the
bad value) if not, or if you prefer local guarding, check
interval.total_seconds() > 0 before the while start < until loop and raise
ValueError if it isn’t; reference symbols: get_gather_interval_hours,
METRICS_UTILITY_GATHER_INTERVAL_HOURS, interval, start, end in collectors.py.
metrics_utility/automation_controller_billing/report_saver/report_saver_s3.py (1)

37-53: ⚠️ Potential issue | 🟠 Major

Avoid logging success when upload fails.

Line 52 logs a success message even after an exception path at Line 49-50, which can hide failed report delivery and degrade operational reliability.

Proposed fix
     def save(self, report_spreadsheet):
@@
-        with tempfile.TemporaryDirectory(prefix='report_saver_billing_data_') as temp_dir:
+        upload_succeeded = False
+        with tempfile.TemporaryDirectory(prefix='report_saver_billing_data_') as temp_dir:
             try:
                 local_report_path = os.path.join(temp_dir, 'report')
                 report_spreadsheet.save(local_report_path)

                 self.s3_handler.upload_file(local_report_path, self.report_spreadsheet_destination_path)
+                upload_succeeded = True

             except Exception as e:
                 logger.exception(f'{self.LOG_PREFIX} ERROR: Saving report to S3 into path {self.report_spreadsheet_destination_path} failed with {e}')

-        logger.info(f'Report sent into S3 bucket into path: {self.report_spreadsheet_destination_path}')
+        if upload_succeeded:
+            logger.info(f'Report sent into S3 bucket into path: {self.report_spreadsheet_destination_path}')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@metrics_utility/automation_controller_billing/report_saver/report_saver_s3.py`
around lines 37 - 53, The success log is executed unconditionally after the
try/except, so failures are still reported as successes; modify the method in
report_saver_s3.py so the logger.info that mentions successful upload
(logger.info(... self.report_spreadsheet_destination_path)) is only called when
no exception occurred — e.g., move that logger.info into the try block
immediately after self.s3_handler.upload_file(...) (or use a try/except/else and
put the info in the else), leaving logger.exception(...) in the except branch
using self.LOG_PREFIX and the caught exception; keep references to
report_spreadsheet.save(...), self.s3_handler.upload_file(...) and
self.report_spreadsheet_destination_path to locate the change.
🧹 Nitpick comments (1)
metrics_utility/library/dataframes/base_dataframe.py (1)

71-76: Add a Returns section to to_parquet for parity with other I/O helpers.

Line 71-76 is the only helper docstring missing explicit return behavior, which makes this API surface slightly less clear than to_csv/to_json.

Suggested docstring tweak
 def to_parquet(df, f=None):
     """Serialise *df* to Parquet format, writing to *f*.
 
     Args:
         df: pandas DataFrame to serialise.
         f: Optional file path or file-like object.
+
+    Returns:
+        Serialized parquet payload when *f* is None; otherwise None (writes to *f*).
     """
     return df.to_parquet(f)

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@metrics_utility/library/dataframes/base_dataframe.py` around lines 71 - 76,
The to_parquet docstring is missing a Returns section; update the docstring for
the function to_parquet to include a clear "Returns" entry stating that the
function writes the DataFrame to the given file/path or file-like object and
returns None (i.e., no meaningful return value), and mention that any bytes are
written to the provided file-like object rather than returned; keep wording
consistent with the Returns sections used by to_csv/to_json for parity and
clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@metrics_utility/library/collectors/controller/config_django.py`:
- Line 12: The function config_django currently uses
mutable/default-instantiated arguments (billing_provider_params={} and
output=DictOutput()), which can retain state across calls; change the signature
to use None defaults (e.g., billing_provider_params=None, output=None) and
inside the config_django function initialize billing_provider_params = {} if
None and output = DictOutput() if None so each call gets fresh instances; update
any internal references to those parameters accordingly (look for usages of
config_django, billing_provider_params, and output in the same file to ensure
behavior is preserved).

In `@metrics_utility/library/collectors/controller/job_host_summary_service.py`:
- Around line 74-92: The batched path (when batch_size is set) currently orders
rows by mu.finished per batch causing pd.concat to produce a final result that
is not globally ordered; change the ordering in the batched query to use mjs.id
ASC to match the keyset partitioning and preserve order across batches—update
the min_max_query and the build_query/ORDER BY clause used by output.batch_sql
(references: batch_size, min_max_query, build_query, output.batch_sql, and the
mjs alias) so each batch is emitted in mjs.id ASC order consistent with
non-batched behavior.

In
`@metrics_utility/library/collectors/controller/main_indirectmanagednodeaudit.py`:
- Around line 49-62: ORDERING mismatch: the current ORDER BY
main_indirectmanagednodeaudit.created ASC only sorts within each id-range batch
so concatenated results won't be globally chronological; change the query
ordering used by build_query and the final output.sql call to ORDER BY
main_indirectmanagednodeaudit.id ASC (i.e., order by the same column used for
batching) so batch_sql's concatenated CSV remains globally ordered, and apply
the same change used in job_host_summary_service to both the batch_sql
build_query lambda and the non-batched build_query.

In `@metrics_utility/library/collectors/controller/main_jobevent.py`:
- Around line 86-107: The min_max_query in main_jobevent.py uses the alias jhs
for main_jobhostsummary but reuses the previously-built where predicate that
references main_jobhostsummary.modified, causing a missing FROM-clause error;
fix by making the predicates consistent: either change min_max_query to
reference the unaliased table (remove the jhs alias) or update the where
predicate to use the alias (e.g., jhs.modified) before passing it into
output.batch_sql; locate the variables and functions min_max_query, where,
build_query, get_batch_size and the call to output.batch_sql and ensure the same
table reference (aliased or not) is used in both the min_max_query and the built
batch query.

In `@metrics_utility/library/collectors/util.py`:
- Around line 11-21: The get_batch_size function should coerce non-positive
parsed values to 0 to avoid infinite loops; update get_batch_size in util.py so
after parsing the environment variable
(os.getenv('METRICS_UTILITY_GATHER_BATCH_SIZE', '0')) it returns 0 for any value
<= 0 (instead of returning negative numbers), ensuring callers like
DataframeOutput.batch_sql and _batch_copy_table_files that rely on "if
batch_size:" do not receive negative batch sizes—parse to int, check <= 0 and
return 0, otherwise return the positive int.

In `@metrics_utility/library/storage/crc.py`:
- Around line 50-57: The docstring for Base.put claims "Exactly one of
*filename*, *fileobj*, or *dict* must be provided" but the implementation of
Base.put currently accepts multiple of these and will perform multiple uploads;
update either the implementation or the docstring to match: either enforce
exclusivity by validating that only one of filename, fileobj, or dict is
non-None (raise ValueError) inside Base.put, or change the docstring wording to
state that any combination is allowed and describe the actual behavior (e.g.,
"One or more of filename, fileobj, or dict may be provided; each will be
uploaded"), referencing the Base.put function and the parameters filename,
fileobj, dict so reviewers can locate the code.

---

Outside diff comments:
In `@metrics_utility/automation_controller_billing/collectors.py`:
- Around line 73-91: The loop in collectors.py can hang when
get_gather_interval_hours() returns 0 or negative, because interval =
timedelta(hours=...) could be zero; guard against this by validating the parsed
value either where it’s read (get_gather_interval_hours in
metrics_utility/base/utils.py) or immediately before using it in collectors.py:
ensure the returned integer is > 0 and raise/log a clear error (including
METRICS_UTILITY_GATHER_INTERVAL_HOURS and the bad value) if not, or if you
prefer local guarding, check interval.total_seconds() > 0 before the while start
< until loop and raise ValueError if it isn’t; reference symbols:
get_gather_interval_hours, METRICS_UTILITY_GATHER_INTERVAL_HOURS, interval,
start, end in collectors.py.

In
`@metrics_utility/automation_controller_billing/report_saver/report_saver_s3.py`:
- Around line 37-53: The success log is executed unconditionally after the
try/except, so failures are still reported as successes; modify the method in
report_saver_s3.py so the logger.info that mentions successful upload
(logger.info(... self.report_spreadsheet_destination_path)) is only called when
no exception occurred — e.g., move that logger.info into the try block
immediately after self.s3_handler.upload_file(...) (or use a try/except/else and
put the info in the else), leaving logger.exception(...) in the except branch
using self.LOG_PREFIX and the caught exception; keep references to
report_spreadsheet.save(...), self.s3_handler.upload_file(...) and
self.report_spreadsheet_destination_path to locate the change.

---

Nitpick comments:
In `@metrics_utility/library/dataframes/base_dataframe.py`:
- Around line 71-76: The to_parquet docstring is missing a Returns section;
update the docstring for the function to_parquet to include a clear "Returns"
entry stating that the function writes the DataFrame to the given file/path or
file-like object and returns None (i.e., no meaningful return value), and
mention that any bytes are written to the provided file-like object rather than
returned; keep wording consistent with the Returns sections used by
to_csv/to_json for parity and clarity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ff7b878e-57a7-4e6c-8497-74694fcaa094

📥 Commits

Reviewing files that changed from the base of the PR and between 828c8c1 and 68d233b.

📒 Files selected for processing (88)
  • docs/environment.md
  • metrics_utility/anonymized_rollups/__init__.py
  • metrics_utility/anonymized_rollups/anonymized_rollups.py
  • metrics_utility/anonymized_rollups/base_anonymized_rollup.py
  • metrics_utility/anonymized_rollups/controller_version_anonymized_rollup.py
  • metrics_utility/anonymized_rollups/credentials_anonymized_rollup.py
  • metrics_utility/anonymized_rollups/events_modules_anonymized_rollup.py
  • metrics_utility/anonymized_rollups/execution_environments_anonymized_rollup.py
  • metrics_utility/anonymized_rollups/jobhostsummary_anonymized_rollup.py
  • metrics_utility/anonymized_rollups/jobs_anonymized_rollup.py
  • metrics_utility/anonymized_rollups/table_metadata_anonymized_rollup.py
  • metrics_utility/automation_controller_billing/base/s3_handler.py
  • metrics_utility/automation_controller_billing/collector.py
  • metrics_utility/automation_controller_billing/collectors.py
  • metrics_utility/automation_controller_billing/dataframe_engine/base.py
  • metrics_utility/automation_controller_billing/dataframe_engine/dataframe_collection_status.py
  • metrics_utility/automation_controller_billing/dataframe_engine/dataframe_content_usage.py
  • metrics_utility/automation_controller_billing/dataframe_engine/dataframe_inventory_scope.py
  • metrics_utility/automation_controller_billing/dataframe_engine/dataframe_jobhost_summary_usage.py
  • metrics_utility/automation_controller_billing/dataframe_engine/db_dataframe_host_metric.py
  • metrics_utility/automation_controller_billing/dataframe_engine/factory.py
  • metrics_utility/automation_controller_billing/dedup/ccsp.py
  • metrics_utility/automation_controller_billing/dedup/factory.py
  • metrics_utility/automation_controller_billing/dedup/renewal_guidance.py
  • metrics_utility/automation_controller_billing/extract/base.py
  • metrics_utility/automation_controller_billing/extract/extractor_controller_db.py
  • metrics_utility/automation_controller_billing/extract/extractor_directory.py
  • metrics_utility/automation_controller_billing/extract/extractor_s3.py
  • metrics_utility/automation_controller_billing/extract/factory.py
  • metrics_utility/automation_controller_billing/helpers.py
  • metrics_utility/automation_controller_billing/package/factory.py
  • metrics_utility/automation_controller_billing/package/package_crc.py
  • metrics_utility/automation_controller_billing/package/package_directory.py
  • metrics_utility/automation_controller_billing/package/package_s3.py
  • metrics_utility/automation_controller_billing/report/base.py
  • metrics_utility/automation_controller_billing/report/factory.py
  • metrics_utility/automation_controller_billing/report/report_ccsp.py
  • metrics_utility/automation_controller_billing/report/report_ccsp_v2.py
  • metrics_utility/automation_controller_billing/report/report_renewal_guidance.py
  • metrics_utility/automation_controller_billing/report_saver/factory.py
  • metrics_utility/automation_controller_billing/report_saver/report_saver_directory.py
  • metrics_utility/automation_controller_billing/report_saver/report_saver_s3.py
  • metrics_utility/base/collection_data_status.py
  • metrics_utility/base/collection_manifest.py
  • metrics_utility/base/utils.py
  • metrics_utility/exceptions.py
  • metrics_utility/library/collectors/controller/config.py
  • metrics_utility/library/collectors/controller/config_django.py
  • metrics_utility/library/collectors/controller/credentials_service.py
  • metrics_utility/library/collectors/controller/execution_environments.py
  • metrics_utility/library/collectors/controller/job_host_summary.py
  • metrics_utility/library/collectors/controller/job_host_summary_service.py
  • metrics_utility/library/collectors/controller/main_host.py
  • metrics_utility/library/collectors/controller/main_indirectmanagednodeaudit.py
  • metrics_utility/library/collectors/controller/main_jobevent.py
  • metrics_utility/library/collectors/controller/unified_jobs.py
  • metrics_utility/library/collectors/others/total_workers_vcpu.py
  • metrics_utility/library/collectors/util.py
  • metrics_utility/library/dataframes/base_dataframe.py
  • metrics_utility/library/dataframes/base_traditional.py
  • metrics_utility/library/dataframes/data_collection_status.py
  • metrics_utility/library/dataframes/host_metric.py
  • metrics_utility/library/dataframes/job_host_summary.py
  • metrics_utility/library/dataframes/main_host.py
  • metrics_utility/library/dataframes/main_jobevent.py
  • metrics_utility/library/debug.py
  • metrics_utility/library/extractors.py
  • metrics_utility/library/instants.py
  • metrics_utility/library/lock.py
  • metrics_utility/library/package.py
  • metrics_utility/library/reports.py
  • metrics_utility/library/storage/crc.py
  • metrics_utility/library/storage/directory.py
  • metrics_utility/library/storage/s3.py
  • metrics_utility/library/storage/segment.py
  • metrics_utility/library/storage/util.py
  • metrics_utility/library/utils.py
  • metrics_utility/logger.py
  • metrics_utility/management/commands/build_report.py
  • metrics_utility/management/commands/gather_automation_controller_billing_data.py
  • metrics_utility/management/validation.py
  • metrics_utility/management_utility.py
  • metrics_utility/metric_utils.py
  • metrics_utility/test/base/classes/analytics_collector.py
  • metrics_utility/test/base/classes/package.py
  • metrics_utility/test/base/functional/helpers.py
  • metrics_utility/test/conftest.py
  • metrics_utility/test/util.py

Comment thread metrics_utility/library/collectors/controller/config_django.py
Comment thread metrics_utility/library/collectors/controller/job_host_summary_service.py Outdated
Comment thread metrics_utility/library/collectors/controller/main_indirectmanagednodeaudit.py Outdated
Comment thread metrics_utility/library/collectors/controller/main_jobevent.py Outdated
Comment thread metrics_utility/library/collectors/util.py Outdated
Comment thread metrics_utility/library/storage/crc.py Outdated
Added Google-style docstrings to all public modules, classes, methods,
and non-trivial functions that previously had none. Covers 86 source
files spanning anonymized_rollups, automation_controller_billing,
base, library, management, test, and tools packages.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 93c2847. Configure here.

Comment thread metrics_utility/library/collectors/controller/main_jobevent.py Outdated
cshiels-ie and others added 2 commits April 27, 2026 12:56
…-update

These constants were pulled in from the batch processing commit during
conflict resolution and do not belong in the docstring-only branch.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@cshiels-ie cshiels-ie changed the title Add missing docstrings across codebase [ DOCs] Add missing docstrings across codebase Apr 27, 2026
@cshiels-ie cshiels-ie requested a review from himdel April 29, 2026 10:12
Copy link
Copy Markdown
Contributor

@himdel himdel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a bad idea,

Humans will interpret the docstrings as authoritative and believe them over code,
AIs will have that much more context to deal with,
and information duplicated in multiple places will slowly go out of sync,
so this is likely to be another maintenance nightmare for the future.

But, if it's a requirement, approved :).

@cshiels-ie cshiels-ie merged commit 9906c7b into ansible:devel Apr 29, 2026
5 checks passed
@cshiels-ie cshiels-ie deleted the Docstring-update branch April 29, 2026 12:48
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