Skip to content

refactor(core): rename taskbase types and files for clarity#414

Merged
kyasbal merged 6 commits into
GoogleCloudPlatform:mainfrom
kyasbal:refactor/inspection-basetask-names
Dec 15, 2025
Merged

refactor(core): rename taskbase types and files for clarity#414
kyasbal merged 6 commits into
GoogleCloudPlatform:mainfrom
kyasbal:refactor/inspection-basetask-names

Conversation

@kyasbal

@kyasbal kyasbal commented Dec 15, 2025

Copy link
Copy Markdown
Member

This PR refactors the pkg/core/inspection/taskbase package and related implementations to improve naming consistency and clarity before releasing it as 0.50.0.
Key Changes:

  • HistoryModifer -> LogToTimelineMapper: Renamed the interface and related tasks to better reflect their role of mapping logs to timeline events (Revisions/Events). "Modifier" was vague and contained a typo ("Modifer").
  • LogSerializerTask -> LogIngesterTask: Renamed to reflect that this task ingests logs into the history builder's storage, rather than just serializing them. And serializing sounds the task serialize logs into files but actually it just preprocess logs before mapping them to timelines.
  • LogGrouper -> LogGrouperFunc: Renamed the functional type for consistency with other function types like LogFilterFunc.
  • File Renaming: Shortened and renamed implementation files in pkg/task/inspection from *historymodifier_task.go to *mapper_task.go for brevity and to match the new type names.
    Breaking Changes:
  • Public interfaces HistoryModifer and LogSerializerTask have been renamed.
  • Consumer implementations of these interfaces have been updated in this PR.

Renames core task interfaces, functions, and files to better reflect their actual responsibilities and improve consistency.
- `HistoryModifer` -> `LogToTimelineMapper`: Maps logs to timeline events.
- `LogSerializerTask` -> `LogIngesterTask`: Ingests logs into history storage.
- `LogGrouper` -> `LogGrouperFunc`: Consistent function naming.
- Renamed related files to `*mapper_task.go` for brevity (e.g., `condition_historymodifier_task.go` -> `conditionmapper_task.go`).
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kyasbal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a significant refactoring effort within the pkg/core/inspection/taskbase package and its related implementations. The primary objective is to enhance naming consistency and clarity across various task types and files. By adopting more descriptive and accurate names, the changes aim to make the codebase easier to understand and maintain, directly contributing to improved long-term readability and developer experience, especially in preparation for the upcoming 0.50.0 release.

Highlights

  • Improved Naming Clarity: Core types and interfaces such as HistoryModifer were renamed to LogToTimelineMapper, LogSerializerTask to LogIngesterTask, and LogGrouper to LogGrouperFunc. These changes aim to better reflect their actual roles and improve consistency across the codebase.
  • File Renaming for Consistency: Numerous implementation files related to history modification tasks, particularly those following the *historymodifier_task.go pattern, were renamed to *mapper_task.go for brevity and to align with the new type names.
  • Breaking Changes Addressed: Public interfaces HistoryModifer and LogSerializerTask underwent renaming. All their consumer implementations within the codebase have been updated in this pull request to ensure compatibility and prevent breakage.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This PR does a great job of refactoring the taskbase types for better clarity and consistency. The renames from HistoryModifer to LogToTimelineMapper and LogSerializerTask to LogIngesterTask are much more descriptive. The changes are applied consistently across a large number of files. I have a few minor suggestions to further improve consistency and fix some small oversights.

Comment thread pkg/core/inspection/taskbase/logingester_task.go Outdated
Comment thread pkg/core/inspection/taskbase/mapper_task_test.go Outdated
Comment thread pkg/task/inspection/commonlogk8sauditv2/contract/taskid.go Outdated
Comment thread pkg/task/inspection/commonlogk8sauditv2/impl/lifetimetracker_task.go Outdated
Comment thread pkg/task/inspection/googlecloudlogcomputeapiaudit/contract/taskid.go Outdated
Comment thread pkg/task/inspection/googlecloudlogmulticloudapiaudit/impl/parser_tasks_test.go Outdated
Comment thread pkg/task/inspection/googlecloudlognetworkapiaudit/contract/taskid.go Outdated
Comment thread pkg/task/inspection/googlecloudlogonpremapiaudit/contract/taskid.go Outdated
Comment thread pkg/task/inspection/googlecloudlogonpremapiaudit/impl/parser_tasks_test.go Outdated
Comment thread pkg/task/inspection/googlecloudlogserialport/contract/taskid.go Outdated
kyasbal and others added 3 commits December 15, 2025 12:58
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: kyasbal <kyasbal1994@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: kyasbal <kyasbal1994@gmail.com>
@kyasbal kyasbal marked this pull request as ready for review December 15, 2025 04:15
@kyasbal

kyasbal commented Dec 15, 2025

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request is a comprehensive refactoring aimed at improving naming consistency and clarity within the taskbase package and its related implementations. The key changes, such as renaming HistoryModifer to LogToTimelineMapper and LogSerializerTask to LogIngesterTask, are well-justified and significantly enhance the descriptiveness of the code. The refactoring has been applied consistently across the codebase, including tests and dependent packages. I've identified a few minor grammatical errors and typos in the comments of the new code. Addressing these will further align the changes with the PR's goal of improving clarity. Overall, this is a valuable refactoring that enhances code quality.

Comment thread pkg/core/inspection/taskbase/logingester_task.go Outdated
Comment thread pkg/core/inspection/taskbase/mapper_task.go Outdated
Comment thread pkg/core/inspection/taskbase/mapper_task.go Outdated
Comment thread pkg/core/inspection/taskbase/mapper_task.go Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: kyasbal <kyasbal1994@gmail.com>
@kyasbal kyasbal merged commit 05605da into GoogleCloudPlatform:main Dec 15, 2025
8 of 9 checks passed
@kyasbal kyasbal deleted the refactor/inspection-basetask-names branch December 15, 2025 04:24
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