Skip to content

Done some changes inside some function inside the core package + Others small changes#145

Merged
akiidjk merged 9 commits intodevfrom
feature/akiidjk-refactor_core
Mar 6, 2026
Merged

Done some changes inside some function inside the core package + Others small changes#145
akiidjk merged 9 commits intodevfrom
feature/akiidjk-refactor_core

Conversation

@akiidjk
Copy link
Copy Markdown
Collaborator

@akiidjk akiidjk commented Mar 6, 2026

This pull requests aim to improve some aspect of the readability and maintenance of the code inside the server/core package and in the addition of all tests for this function read ANALYSIS.md inside the PR for more information about the tests and the structure of the package.

Others minor changes are done inside the PR.

  • Add testify dependency for simplify some aspect of the testing process
  • Fixed a wrong query related to old flags based on TTL
  • Add parallel testing with a max of 10 inside the test command in justfile
  • Update some dependencies (not new deps only run go mod tidy for sync)

@KronosPNG this PR is not complete write me witch part of the documentation miss inside the ANALYSIS.md file. I have not do big or complex edit to the flow, or the logic of the core package.


Warning

Copilot summary down

Dependency updates and additions:

  • Updated several dependency versions in cookiefarm/client/config/go.mod, including github.com/kr/pretty and gopkg.in/check.v1, and added github.com/rogpeppe/go-internal.
  • Added github.com/stretchr/testify v1.11.1 as an indirect dependency to multiple go.mod files (cookiefarm/client/api/go.mod, cookiefarm/client/go.mod, cookiefarm/client/websockets/go.mod, cookiefarm/pkg/logger/go.mod, cookiefarm/server/api/go.mod). [1] [2] [3] [4] [5]
  • Expanded the dependency list in cookiefarm/client/exploit/go.mod, adding github.com/ByteTheCookies/CookieFarm, several Charmbracelet packages, and others for enhanced functionality.
  • Updated and added entries in cookiefarm/go.work.sum to reflect new and changed dependencies, including new versions and removals for several packages. [1] [2] [3]

Code and UI improvements:

  • Fixed a minor UI issue in cookiefarm/client/tui/view.go by changing the process selection list separator from "─" to "-" for better compatibility.
  • Corrected the import grouping in cookiefarm/pkg/protocols/cc_http.go to follow Go conventions.
  • Modified the server startup logic in cookiefarm/server/cmd/root.go to separate config loading and running, improving clarity and error handling.

akiidjk added 9 commits March 5, 2026 22:09
Cover NewRunner, Run, LoadConfig, UpdateFlags, StartFlagProcessingLoop,
ValidateFlagTTL, and add test helpers for in-memory DB, submit stubs,
and timing utilities
Replace Unicode section separators with ASCII dashes across tests.

Change DeleteFlagByTTL to compare response_time with
(CAST(strftime('%s', 'now') AS INTEGER) - ?) and regenerate query code
(param name updated).

Add module checksums to go.work.sum:
crawshaw.io/sqlite v0.3.2/go.mod
github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.1/go.mod
github.com/joho/godotenv v1.5.1/go.mod
@akiidjk akiidjk self-assigned this Mar 6, 2026
@akiidjk akiidjk added documentation Improvements or additions to documentation Clean Code Clean THIS! dependencies Pull requests that update a dependency file go Pull requests that update go code labels Mar 6, 2026
@KronosPNG
Copy link
Copy Markdown
Collaborator

@akiidjk there's no issue with the pull request description nor with internal files that make it easier to understand a specific module/subsystem.

We're not following the test-driven approach we discussed, there's no test plan, no test case specification, we have discussed using category partitioning, since there's no case specification, there's no way category partitioning can be applied.

We don't need a dependency graph for each submodule, although useful.

We agreed to analyse the system as a whole beforehand, document the state of the project, plan future operations, then proceed with reengineering, nothing like that has been done.

I cannot give a lot of comments on the code itself, but everything else is not on par with the goals we set up together.

@akiidjk
Copy link
Copy Markdown
Collaborator Author

akiidjk commented Mar 6, 2026

I will work on the missing part indicated. For fill the gaps

@KronosPNG
Copy link
Copy Markdown
Collaborator

KronosPNG commented Mar 6, 2026

And although I understand the need to change a large amount of files, adding new ones to make the previous work, but consider making smaller pull requests or requesting review per commit instead of leaving 2k loc to analyse to the others

Copy link
Copy Markdown
Collaborator

@KronosPNG KronosPNG left a comment

Choose a reason for hiding this comment

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

Code LGTM

@akiidjk
Copy link
Copy Markdown
Collaborator Author

akiidjk commented Mar 6, 2026

Most of the code concerns updating dependencies or formatting issue, so it can be skipped. But I will follow the advice

@akiidjk akiidjk merged commit ab3858b into dev Mar 6, 2026
1 of 2 checks passed
@akiidjk akiidjk deleted the feature/akiidjk-refactor_core branch March 6, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Clean Code Clean THIS! dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants