Skip to content
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

Implement LiquidCachedAssigns #1266

Merged
merged 8 commits into from
Jun 27, 2024
Merged

Implement LiquidCachedAssigns #1266

merged 8 commits into from
Jun 27, 2024

Conversation

aapomm
Copy link
Contributor

@aapomm aapomm commented Jun 14, 2024

Spec

The LiquidAssignsService does a lookahead of the content but this can be skipped if we implement a lazily loaded liquid assigns that would simplify the code.

Proposed solution
To lazily load the drops, we implement a LiquidCachedAssigns class to replace the LiquidAssignsService and does the following:

  • quacks like a hash {}
  • when it receives a message, it validates if it's associated with a list of records ('issues', 'notes', etc.)
    • if valid, it fetches the records from the project
    • if invalid, check if if it present in the current @assigns hash (to catch the case for record-based assigns)

Other Information

If there's anything else that's important and relevant to your pull
request, mention that information here. This could include
benchmarks, or other information.

Thanks for contributing to Dradis!

Copyright assignment

Collaboration is difficult with commercial closed source but we want
to keep as much of the OSS ethos as possible available to users
who want to fix it themselves.

In order to unambiguously own and sell Dradis Framework commercial
products, we must have the copyright associated with the entire
codebase. Any code you create which is merged must be owned by us.
That's not us trying to be a jerks, that's just the way it works.

Please review the CONTRIBUTING.md
file for the details.

You can delete this section, but the following sentence needs to
remain in the PR's description:

I assign all rights, including copyright, to any future Dradis
work by myself to Security Roots.

Check List

  • Added a CHANGELOG entry

app/services/liquid_cached_assigns.rb Outdated Show resolved Hide resolved
app/services/liquid_cached_assigns.rb Outdated Show resolved Hide resolved
@aapomm aapomm merged commit b027497 into develop Jun 27, 2024
3 checks passed
@aapomm aapomm deleted the liquid/cached-assigns branch June 27, 2024 07:43
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.

None yet

3 participants