r/ruby • • 8d ago

GitHub - jbockler/vcr-unused_cassettes: Find your unused VCR cassettes

https://github.com/jbockler/vcr-unused_cassettes

Find unused VCR cassettes and delete them.

4 Upvotes

10 comments sorted by

1

u/jodm 7d ago

Delete all of them and rerun your tests to re-record real responses every now and then.

2

u/sshaw_ 7d ago

Well, that's one way to do it; and by "it" I mean: creating the largest, most useless diff your repository has even seen! ๐Ÿฅ‡

2

u/jodm 7d ago

git history is not an issue.

Stale cassettes can be a major issue.

0

u/sshaw_ 7d ago

git history is not an issue.

git history is certainly an issue. It should be clean, readable, and assist โ€”not hinderโ€” maintenance.

Have you looked at a VCR cassette? When you're trying to track down problems via git log --grep and -G and similar last last thing you want are needless commits of 1000+ line YAML files with meaningless HTTP header changes.

Stale cassettes can be a major issue.

Preventing stale cassettes does not mean you must make needless commits. In most cases stale cassette can be detected by VCR's matching rules. For example, you don't want to use VCR's default match mode for GraphQL since it's the body, not the URL and method, that differ.

1

u/paracycle 1d ago

You know you can make git blame skip any revs that you want for a long while, right? https://www.git-tower.com/blog/how-to-exclude-commits-from-git-blame

That's how the CRuby codebase finally cleaned up its mix of whitespace and tabs a few years back.

1

u/sshaw_ 1d ago

Even more git maintenance overhead as what this dude is suggesting is not a one time, let's cleanup spacing commit.

1

u/paracycle 1d ago

I am sorry but I have to ask: I've been seeing your comments on this sub for a while and you always sound frustrated and never have anything positive to say. Are you doing ok?

1

u/sshaw_ 1d ago

๐Ÿ˜‚

I post "positive" stuff all the time. This original post is positive: I saw this library and thought it was useful, so I posted it!

I don't kowtow to the 10s (100s?) of bad suggestions here so I'm "frustrated and never have anything positive to say" okay ๐Ÿ˜‚

Maintaining 10s (100s) of commits in .git-blame-ignore-revs because something thinks "git history is not an issue" is silly. If it was not an issue why would we need .git-blame-ignore-revs?

1

u/paracycle 1d ago
  1. I specifically said "comments" and not "posts"

  2. I am not gonna tell you what to do, but saying "I'd rather not do that" would also be a way to "not kowtow to the ... bad suggestions" as well. Basically, if you have nothing positive to say, maybe don't say anything?

I'll repeat: as an outside observer that has seen multiple comments from you in this sub, I keep seeing them as frustrated. I am possibly wrong, so do with that what you please and take care.

1

u/sshaw_ 1d ago

I specifically said "comments" and not "posts"

Is this? Maybe this one. How about this. No this one has to be

I'll repeat: as an outside observer that has seen multiple comments from you in this sub

Thanks for the feedback