-
-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Refactor code structure #672
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @hahwul, 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!
Summary of Changes
This pull request focuses on refactoring the code structure of the project. The primary change involves moving several packages from pkg
to internal
, specifically har
, printing
, optimization
, report
, and verification
. Additionally, a new Rake task for checking remote assets has been added, which fetches and prints data from specified endpoints.
Highlights
- Package Relocation: Moved
har
,printing
,optimization
,report
, andverification
packages frompkg
tointernal
to better encapsulate internal functionalities. - New Rake Task: Implemented a new Rake task
assets:check
to verify remote assets by fetching and displaying data from predefined endpoints. - Code View Test: Added a test case for the
CodeView
function in theinternal/printing
package to ensure proper functionality.
Changelog
Click here to see the changelog
- Rakefile
- Added
net/http
andjson
requires. - Implemented
assets:check
task to fetch and display data from remote asset endpoints.
- Added
- cmd/file.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- cmd/payload.go
- Moved
generating
,optimization
, andprinting
imports frompkg
tointernal
.
- Moved
- cmd/pipe.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- cmd/root.go
- Moved
har
andprinting
imports frompkg
tointernal
.
- Moved
- cmd/server.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- cmd/sxss.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- cmd/url.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- cmd/version.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- internal/har/har_test.go
- Moved
har
import frompkg
tointernal
.
- Moved
- internal/optimization/optimization.go
- Moved
har
import frompkg
tointernal
.
- Moved
- internal/printing/codeview.go
- Changed package from
scanning
toprinting
.
- Changed package from
- internal/printing/codeview_test.go
- Added a new test file for
CodeView
function.
- Added a new test file for
- internal/printing/util_test.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- lib/interface.go
- Moved
har
import frompkg
tointernal
.
- Moved
- pkg/model/options.go
- Moved
har
import frompkg
tointernal
.
- Moved
- pkg/scanning/bav.go
- Moved
optimization
import frompkg
tointernal
.
- Moved
- pkg/scanning/foundaction.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- pkg/scanning/parameterAnalysis.go
- Moved
optimization
,printing
, andverification
imports frompkg
tointernal
.
- Moved
- pkg/scanning/scan.go
- Moved
har
,optimization
,printing
,report
, andverification
imports frompkg
tointernal
.
- Moved
- pkg/scanning/sendReq.go
- Moved
har
,optimization
,printing
, andverification
imports frompkg
tointernal
.
- Moved
- pkg/scanning/staticAnlaysis.go
- Moved
optimization
import frompkg
tointernal
.
- Moved
- pkg/scanning/transport.go
- Moved
har
andprinting
imports frompkg
tointernal
.
- Moved
- pkg/scanning/transport_test.go
- Moved
har
import frompkg
tointernal
.
- Moved
- pkg/server/server.go
- Moved
printing
import frompkg
tointernal
.
- Moved
- scripts/check-asset-remote.rb
- Removed the file.
- scripts/check-before-release.sh
- Removed the file.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 is currently in preview and 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 to provide feedback.
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.
In the realm of code, where structures reside,
A refactor emerges, with purpose and pride.
Packages shift, like stars in the night,
Internal workings, shielded from light.
Rake tasks awaken, assets to seize,
Checking remote realms, putting minds at ease.
Footnotes
-
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. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request refactors the code structure by moving some packages to internal packages and adding a new Rake task to check remote assets. The changes seem well-organized and improve the project's structure.
Summary of Findings
- Moving packages to internal: Several packages like
generating
,optimization
,printing
, andhar
have been moved frompkg
tointernal
. This restricts external access and better defines the project's public API. This is a good change. - New Rake task for asset checking: A new Rake task
assets:check
has been added to check remote assets. This task fetches JSON data from a remote server and prints it. This could be useful for verifying external dependencies or resources. - Comment capitalization: Several comments in
pkg/scanning/bav.go
have incorrect capitalization. This should be corrected for consistency.
Merge Readiness
The pull request is almost ready for merging. The changes improve the code structure and add a useful Rake task. However, the capitalization issue in the comments should be addressed before merging. I am unable to directly approve the pull request, and users should have others review and approve this code before merging. Since there are no critical or high severity issues, the pull request can be merged after the medium severity issues are addressed.
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Code Refactoring