Skip to content

refactor: deduplicate agent hook post requests#4195

Open
HariVeeraManiKumarVallu wants to merge 1 commit into
keploy:mainfrom
HariVeeraManiKumarVallu:refactor-agent-hook-posts
Open

refactor: deduplicate agent hook post requests#4195
HariVeeraManiKumarVallu wants to merge 1 commit into
keploy:mainfrom
HariVeeraManiKumarVallu:refactor-agent-hook-posts

Conversation

@HariVeeraManiKumarVallu
Copy link
Copy Markdown

@HariVeeraManiKumarVallu HariVeeraManiKumarVallu commented May 12, 2026

Move repeated agent hook POST logic into a shared helper and simplify agent service command validation. This reduces duplicated request setup code without changing hook behavior.

Signed-off-by: HariVeeraManiKumarVallu manikumarvallu@gmail.com

Describe the changes that are made

  • Simplified agent service command validation by returning early for invalid commands.
  • Moved repeated agent hook POST request logic into a shared helper.
  • Reduced duplicated request setup code while preserving existing hook behavior.

Links & References

Closes: #[issue number that will be closed through this PR]

  • NA (if very small change like typo, linting, etc.)

🔗 Related PRs

  • NA

🐞 Related Issues

  • NA

📄 Related Documents

  • NA

What type of PR is this? (check all applicable)

  • 📦 Chore
  • 🍕 Feature
  • 🐞 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • [ ✔] 🧑‍💻 Code Refactor
  • ⏩ Revert
  • 🔥 Performance Improvements
  • ✅ Test
  • 🔁 CI

Added e2e test pipeline?

  • 👍 yes
  • [ ✔] 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added comments for hard-to-understand areas?

  • 👍 yes
  • [ ✔] 🙅 no, because the code is self-explanatory

Added to documentation?

  • 📜 README.md
  • 📓 Wiki
  • [ ✔]🙅 no documentation needed

Are there any sample code or steps to test the changes?

  • [ ✔] 👍 yes, mentioned below
  • 🙅 no, because it is not needed

Self Review done?

  • [✅ ] ✅ yes
  • ❌ no, because I need help

Any relevant screenshots, recordings or logs?

  • NA

🧠 Semantics for PR Title & Branch Name

Please ensure your PR title and branch name follow the Keploy semantics:

📌 PR Semantics Guide
📌 Branch Semantics Guide

Examples:

  • PR Title: fix: patch MongoDB document update bug
  • Branch Name: feat/#1-login-flow (You may skip mentioning the issue number in the branch name if the change is small and the PR description clearly explains it.)

Additional checklist:

Move repeated agent hook POST logic into a shared helper and simplify agent service command validation. This reduces duplicated request setup code without changing hook behavior.

Signed-off-by: HariVeeraManiKumarVallu <manikumarvallu@gmail.com>
@github-actions
Copy link
Copy Markdown

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@github-actions
Copy link
Copy Markdown

The CLA check failed. Please ensure you have:

  • Signed the CLA by commenting 'I have read the CLA Document and I hereby sign the CLA.'
  • Used the correct email address in your commits (matches the one you used to sign the CLA).

After fixing these issues, comment 'recheck' to trigger the workflow again.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Thank you and congratulations 🎉 for opening your very first pull request in keploy

@HariVeeraManiKumarVallu
Copy link
Copy Markdown
Author

Hi maintainers, I have signed the CLA. Could you please approve the pending workflows when you get a chance?

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.

1 participant