-
Notifications
You must be signed in to change notification settings - Fork 792
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
2261 get progenitor #2333
2261 get progenitor #2333
Conversation
@@ -40,6 +40,16 @@ def get_running_agents(self) -> Sequence[Agent]: | |||
:raises RetrievalError: If an error occurred while attempting to retrieve the `Agents` | |||
""" | |||
|
|||
@abstractmethod | |||
def get_progenitor(self, descendant: Agent) -> Agent: |
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.
We should probably just name the parameter 'agent'. Descendant means that it's not the progenitor, but in fact this method might get called where descendant
IS the progenitor. It's pretty clear from the signature get_progenitor(self, agent)
that you're getting a progenitor of an agent. IF not, then let's change the name to get_agent_progenitor
monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_agent_repository.py
Outdated
Show resolved
Hide resolved
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.
Mainly I don't see why we can't search progenitor of an agent which is already a progenitor
5f3c615
to
13ec61d
Compare
13ec61d
to
0443c99
Compare
monkey/tests/unit_tests/monkey_island/cc/repository/test_mongo_agent_repository.py
Outdated
Show resolved
Hide resolved
0443c99
to
8035abe
Compare
@@ -244,6 +244,8 @@ | |||
IAgentRepository.upsert_agent | |||
IAgentRepository.get_agent_by_id | |||
IAgentRepository.get_running_agents | |||
IAgentRepository.get_progenitor | |||
descendant |
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.
Where is this from?
""" | ||
Gets the progenitor `Agent` for the agent. | ||
|
||
:param agent: The Agent for which we want the progenitor | ||
:return: `Agent` progenitor ( an initial agent that started the exploitation chain) | ||
:raises RetrievalError: If an error occured while attempting to retrieve the `Agent` | ||
:raises UnknownRecordError: If the agent ID is not in the repository | ||
""" |
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.
""" | |
Gets the progenitor `Agent` for the agent. | |
:param agent: The Agent for which we want the progenitor | |
:return: `Agent` progenitor ( an initial agent that started the exploitation chain) | |
:raises RetrievalError: If an error occured while attempting to retrieve the `Agent` | |
:raises UnknownRecordError: If the agent ID is not in the repository | |
""" | |
""" | |
Gets the progenitor agent (initial agent that started the exploitation chain) for a particular agent | |
:param agent: The agent whose progenitor should be retrieved | |
:return: The progenitor agent | |
:raises RetrievalError: If an error occurs while attempting to retrieve an agent | |
:raises UnknownRecordError: If the agent ID is not in the repository | |
""" |
What does this PR do?
Fixes part of #2261 .
PR Checklist
Was the CHANGELOG.md updated to reflect the changes?Was the documentation framework updated to reflect the changes?Testing Checklist