Skip to content

Conversation

@arash77
Copy link
Member

@arash77 arash77 commented Jan 22, 2026

Add test credential support for tool definitions (#19084).

Introduces definitions for test credentials and implements parsers to inject them during tool test execution.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@arash77 arash77 changed the title Add support for test credentials in tools [WIP] Add support for test credentials in tools Jan 22, 2026
@arash77 arash77 force-pushed the add-credentials-tests branch from 0c895a5 to c388cf5 Compare January 27, 2026 11:32
@arash77 arash77 force-pushed the add-credentials-tests branch from 5bb4368 to eef2ffa Compare January 27, 2026 12:02
@arash77 arash77 marked this pull request as ready for review January 28, 2026 14:11
@arash77 arash77 changed the title [WIP] Add support for test credentials in tools Add support for test credentials in tools Jan 28, 2026
@github-actions github-actions bot modified the milestone: 26.1 Jan 28, 2026

# Handle credentials_context - can be either:
# - JSON string (legacy API from planemo)
# - dict (test mode with embedded values from planemo)
Copy link
Member

Choose a reason for hiding this comment

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

Tool tests can be run different ways than Planemo - I don't really think any of these comments should mention Planemo.

Can we rename TestCredentialValue -> DirectCredentialValue and and CredentialsContext -> VaultCredentialsContext. I think if we didn't explicitly have so much test code in the backend runtime I would feel better.

If Planemo cannot do this today - why are there two different ways the credentials might come in (JSON string vs dict)? That doesn't make sense to me - this is all new functionality right - can we just have a normal run parameter that is the directly applying the credentials and just document for most production applications it shouldn't be used and the Vault should be used instead?

**extra_data,
)
if credentials_context:
data["credentials_context"] = dumps(credentials_context)
Copy link
Member

Choose a reason for hiding this comment

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

I guess because you're supporting credentials down both of these paths - this is why you have the dispatch down below. I think the Planemo comment confused me.

I guess we need the dumps here right? Because we don't have json=True like below?

credentials_context: Optional[CredentialsContext | TestCredentialsContext] = None
if credentials_context_raw:
# Parse JSON string if needed
if isinstance(credentials_context_raw, str):
Copy link
Member

Choose a reason for hiding this comment

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

I think maybe I would like to see this a bit different - I think keep credentials_context as it is and introduce a "direct_credentials" parameter. On the client side I thought it was a little confusing that it was called credentials_context and not "credentials" or something like that - maybe "direct_credentials" would make sense.

}
for service in credentials_context.root
}
job.add_parameter("__test_credentials__", json.dumps(test_creds_dict))
Copy link
Member

Choose a reason for hiding this comment

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

Again I would prefer direct credentials - or something else without test in the name. I also think we should create a database field for this. I know that is a lot more work but I can point you at some documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants