Skip to content

Conversation

@spatten
Copy link
Contributor

@spatten spatten commented Nov 15, 2025

Overview

Delivers ANE-2616

This PR updates the documentation for fossa analyze --x-snippet-scan

  1. Move most of the documentation out of docs/references/subcommands/analyze.md and into docs/features/snippet-scanning.md. The subcommand documentation links to the feature documentation.
  2. Add a section talking about scan speeds and how they get faster the second time you scan something
  3. Add a note about how you need a feature flag switched on to use this
  4. Add a section describing the snippet scan summary
  5. Link to the snippet scan summary documentation from the snippet scan in the CLI output

Links to rendered files:

Acceptance criteria

  • The documentation is clear
  • The link to the snippet scan documentation after the summary is correct

Testing plan

This is mostly documentation, but I tested that the new link at the end of the snippet scan summary is correct.

Follow the testing plan for #1613. The link at the bottom of the snippet scan summary will look like this:

  ============================================================
  Snippet scan summary:
    Analysis ID: 122839
    Bucket ID: 123373
    Files skipped: 6
    Total Files processed: 18
    Unique Files processed: 13
    Unique Files with matches found: 4
    Unique Files with no matches found: 9
    Unique Files already in our knowledge base: 13
    Unique Files new to our knowledge base: 0
    Processing time: 7.776s
  ============================================================
  See the docs for an explanation of this summary: https://github.com/fossas/fossa-cli/blob/master/docs/features/snippet-scanning.md#the-snippet-scan-summary

That link won't work right now, but it will once this is merged and on master. So change the tag from master to 116ab36adc153ea76745517092976da4cff92d14 and check that it works

https://github.com/fossas/fossa-cli/blob/cfd041bbcd7ad2126b7a83a95f4394bd4a093ba1/docs/features/snippet-scanning.md#the-snippet-scan-summary

Risks

Metrics

References

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this PR added docs, I added links as appropriate to the user manual's ToC in docs/README.ms and gave consideration to how discoverable or not my documentation is.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an ## Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json AND I have updated example files used by fossa init command. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).
  • If I made changes to a subcommand's options, I updated docs/references/subcommands/<subcommand>.md.

@spatten spatten marked this pull request as ready for review November 17, 2025 22:41
@spatten spatten requested a review from a team as a code owner November 17, 2025 22:41
@spatten spatten requested review from csasarak and removed request for a team November 17, 2025 22:42
@spatten spatten force-pushed the ANE-2616-snippet-scan-docs branch from cfd041b to 130e4c0 Compare November 18, 2025 19:02
Copy link
Contributor

@csasarak csasarak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I mostly left questions.

One thing I'd like to see is if you could add this and some of its sections to the main manual ToC: https://github.com/fossas/fossa-cli/blob/master/docs/README.md

In lieu of an mdbook setup, I've been trying to keep a mostly flat list of topics for folks. It's hard to know what you don't know and that index is meant to help address that.

fossa analyze --x-snippet-scan
```

Snippet Scanning must also be enabled for your organization, and is only available for enterprise customers. If you would like to enable it for your organization, please [contact us](https://support.fossa.com).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a simple way to verify that it is enabled? It may be good to describe that if so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I can think of, unfortunately. I'm going to just leave this and maybe we can fix it if it turns out to be a problem in the future

4. **Filters Content**: By default, skips directories like `.git/`, and hidden directories. This includes, from `.fossa.yml`, `vendoredDependencies.licenseScanPathFilters.exclude`, documented further below.
5. **Uploads Fingerprints**: Sends only the fingerprints to FOSSA's servers
6. **Receives Matches**: Gets back information about any matching open source components
7. **Uploads Match Contents**: For files that have matches, uploads source code content temporarily to FOSSA servers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you characterize temporarily a bit more? Is this optional? If I were a customer reading this I'd want more details since the idea that you're uploading source code could be a bit alarming.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see that you wrote about it more down below. Maybe reference that section here for people like me who freak out before reading the whole doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Done!


#### Custom Exclude Filtering

You can customize which files and directories are excluded from snippet scanning by configuring exclude filters in your `.fossa.yml` file. Note that snippet scanning currently only supports exclude patterns, not `only` patterns.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this last sentence meant to contrast snippet filtering with our currently existing ones?


## A note on scan times

The first time you run a snippet scan on a codebase, it may take a long time to scan. For example, scanning [Linux](https://github.com/torvalds/linux) for the first time takes around 60 minutes. This is because most of the files in your codebase will not exist in FOSSA's knowledge base, and we will need to fingerprint and compare all of them to our snippet scan corpus.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we recommend running an initial manual scan to "prime" before turning this on in CI?

I could see someone naively just turning this on in CI and having a ton of jobs (due to multiple simultaneous pushes/revisions) all start doing the full-scan. I think that'd be bad for Sparkle and also a poor experience for the customer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe a future future version of this (if it's a problem at all) could use content to know if two scans are basically the same and then only let one of them proceed while the others just wait.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of recommending that they do an initial scan. I think this takes care of 99% of the problem, as those hypothetical parallel scans will then do almost no work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth communicating this to support as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good point. I'll mention it in the support and snippet scanning channel

Base automatically changed from snippet-scan-summary to master November 21, 2025 18:38
@spatten spatten enabled auto-merge (squash) November 21, 2025 18:41
@spatten spatten merged commit b926d24 into master Nov 21, 2025
19 checks passed
@spatten spatten deleted the ANE-2616-snippet-scan-docs branch November 21, 2025 19:03
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.

3 participants