question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better cache invalidation for custom, local generators

See original GitHub issue

Follows https://github.com/thesamet/sbt-protoc/pull/162

How can we accurately fingerprint protoc-bridge local (defined in the meta-build) generators behind PB.targets, to avoid false positive cache hits on local workspaces ~as ScalaPB/sbt-akka-grpc gets bumped for example~?

Looking up a potential serialVersionUID on Generator would allow generators to declare their version, but it leaves that responsibility to the generator author to bump this… ~I can’t think of any other way - maybe something related to JAR timestamps?~

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
thesametcommented, Jan 11, 2021

I recently wrote a guide that tries to consolidate the best practices and all magic involved in writing plugins: https://scalapb.github.io/docs/writing-plugins

It comes with an sbt plugin, as well as a g8 template to get projects set up correctly. This is used in scalapb-validate and zio-grpc.

Specifically, to run plugins to run from a local project, it provides codeGenClassPath and genModule. Currently it re-generates sources on any compile, but the improvement we identified above can go in here.

0reactions
thesametcommented, Jan 13, 2021

I am not sure how far/generic you would like this to be, as I assume this plugin was only meant for e2e testing, not for defining generators in a monorepo?

Thanks for trying this! Right, when writing this plugin I had in mind projects like ScalaPB/zio-grpc/scalapb-validate which are meant to produce a protoc plugin and have one or two e2e projects to verify it. Will gladly accept PRs that improve performance and how classloader caching is done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caching and invalidation have never been so easy - GitHub
The package supports tag-based cache invalidation and better works with Django, ... it's # better to write custom cache key generator in such...
Read more >
Cache Invalidation — VQL Guide - Community | Denodo
The cache of a view can be invalidated using the ALTER VQL sentence (see section Modifying a Derived View). There are two types...
Read more >
Configuring Infinispan caches
If a cache is configured for invalidation, every time data is changed in a cache, other caches in the cluster receive a message...
Read more >
GenerateSwaggerCode task does not invalidate local cache ...
I'm running gradle-swagger-generator-plugin GenerateSwaggerCode task on an input yaml that contains a $refs to another file.
Read more >
Application Data Caching - Quarkus
This key generator is not a CDI bean. 4, The @CacheKey annotation will be ignored when the foo cache data is invalidated, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found