Increate context detection for jobs#130
Open
microstudi wants to merge 1 commit intomainio:mainfrom
Open
Conversation
* increase component detection * apply review * ensure only hash and arrays * fix missing helper * fix missing helper
There was a problem hiding this comment.
Pull request overview
This PR strengthens Decidim::TermCustomizer::Context::JobContext argument resolution so background jobs can reliably detect organization/space/component/user even when passed inside nested arrays/hashes, and it tightens rake task specs to assert clean stderr output.
Changes:
- Add recursive argument scanning helpers in
JobContextto find objects by class or via accessor methods inside nested arrays/hashes. - Extend
JobContextspecs to cover nested user arguments and resolving component/space via questionnaires. - Improve rake task specs by asserting “no stderr output” using a new
not_outputmatcher.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/spec_helper.rb | Defines not_output matcher to support chained “no stderr” assertions in specs. |
| spec/lib/decidim/term_customizer/context/job_context_spec.rb | Adds coverage for nested arguments and questionnaire-based context resolution. |
| spec/lib/decidim/tasks/decidim_term_customizer_combine_file_spec.rb | Updates task spec to assert stdout output and no stderr output. |
| spec/lib/decidim/tasks/decidim_term_customizer_combine_db_spec.rb | Updates task spec to assert stdout output and no stderr output. |
| lib/decidim/term_customizer/context/job_context.rb | Implements recursive lookup through nested argument structures and questionnaire-to-component resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Strengthened internal argument resolution to handle nested data structures more reliably when identifying users, organizations, and components in complex scenarios.
This is motivated by some mailer jobs that can have the user or components deeper in arguments hashes or arrays.