Repository navigation
Conversation
A function input's value is either a string or a credential object, so FunctionInputValue holds both and a Gson factory reads each form. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## api #1718 +/- ##
============================================
- Coverage 73.91% 73.80% -0.12%
+ Complexity 4797 4793 -4
============================================
Files 489 490 +1
Lines 14959 14967 +8
Branches 1562 1572 +10
============================================
- Hits 11057 11046 -11
- Misses 2977 2990 +13
- Partials 925 931 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
WilliamBergamin
left a comment
There was a problem hiding this comment.
🧩 Thanks @zimeg! Typing this with an adapter like StepInputValue and DetailsAction is a nice fit, and the strict-mode test for unknown keys is a good guard.
One blocking comment on input values beyond strings and credentials, plus the tests for it 🙏
| if (json.isJsonPrimitive()) { | ||
| result.setStringValue(json.getAsString()); | ||
| return result; | ||
| } else if (json.isJsonObject()) { |
There was a problem hiding this comment.
🧠 issue (blocking): Trigger inputs can be any value (docs), like an array of user IDs. Today an array or a plain object comes back all-null, or throws in strict mode, and true/42 become strings. Could we add stringValues like GsonAppWorkflowStepInputValueFactory and keep the raw value as a fallback?
| "}"; | ||
|
|
||
| @Test | ||
| public void deserialize_string() { |
There was a problem hiding this comment.
🧪 issue (blocking): Every test here runs strict mode with a string or a credential. Could we add the default lenient parse of an unknown key, an array, and a non-credential object, plus serializing an empty value?
| // e.g., "https://api.github.com/repos/..." for a string input | ||
| private String stringValue; | ||
| // credential inputs |
There was a problem hiding this comment.
🪓 suggestion (non-blocking): These comments repeat the field names. The factory tests already show both forms, so we could drop them.
| // e.g., "https://api.github.com/repos/..." for a string input | |
| private String stringValue; | |
| // credential inputs | |
| private String stringValue; | |
| private String credentialSource; |
Summary
This pull request types
AppActivity.FunctionInput.valuefromadmin.apps.activities.listinstead of leaving it asObject.credential_source,external_token_idanduser_context_sourcefor inputs that use external authentication.AppActivity.FunctionInputValueholds either form, and a newGsonAppActivityFunctionInputValueFactory, registered inGsonFactory, reads both, the same wayLogsResponse.DetailsActionreadsdetails.action.failOnUnknownPropertieson, unknown keys in the object form raise an error.FunctionInputis new in #1636, so this changes nothing that has been released. Merging this lands it in #1636.Testing
With an org admin token that has
admin.app_activities:read, calladmin.apps.activities.listfor an app whose workflow trigger has a string input and an external authentication input, and confirmgetValue().getStringValue()andgetValue().getCredentialSource()are set.Category
Requirements
🤖 Generated with Claude Code