Skip to content

Conversation

@gautambhat
Copy link
Contributor

@gautambhat gautambhat commented Dec 1, 2025

  • I ran make setup && make to update the generated code after editing a .atd file (TODO: have a CI check)
  • I made sure we're still backward compatible with old versions of the CLI.
    For example, the Semgrep backend need to still be able to consume data
    generated by Semgrep 1.50.0.
    See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades
    Note that the types related to the semgrep-core JSON output or the
    semgrep-core RPC do not need to be backward compatible!
  • Any accompanying changes in semgrep-proprietary are approved and ready to merge once this PR is merged

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Backwards compatibility summary:

Checking backward compatibility of semgrep_output_v1.atd against past version v1.100.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.101.0
Skipping v1.102.0 because commit 1c82453e89e0b569630e48ddde015e201df0e5f9 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.103.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.104.0
Skipping v1.106.0 because commit 5e0c767ec323f3f2356d3bf8dbdf7c7836497d8a has already been checked
Skipping v1.107.0 because commit 5e0c767ec323f3f2356d3bf8dbdf7c7836497d8a has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.108.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.109.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.110.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.111.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.112.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.113.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.114.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.116.0
Skipping v1.117.0 because commit 5c6a8f569d16845ba10c27d17eeae68e481340d6 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.118.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.119.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.120.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.121.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.122.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.123.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.124.0
Skipping v1.124.1 because commit 75ab2f389a373af38a2a29872b4fa1c654d182f0 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.125.0
Skipping v1.126.0 because commit 02c7c65f6508daac0c9d5c0c54981731a134b038 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.127.0
Skipping v1.127.1 because commit 80fa4d2466c737b570c4f363edadc2b336e5696d has already been checked
Skipping v1.128.0 because commit 80fa4d2466c737b570c4f363edadc2b336e5696d has already been checked
Skipping v1.128.1 because commit 80fa4d2466c737b570c4f363edadc2b336e5696d has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.130.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.131.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.132.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.132.1
Checking backward compatibility of semgrep_output_v1.atd against past version v1.133.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.134.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.135.0
Skipping v1.136.0 because commit 85c728ef38c1aef822f28035078fa2671ec7d10a has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.137.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.137.1
Checking backward compatibility of semgrep_output_v1.atd against past version v1.138.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.139.0
Skipping v1.140.0 because commit 8baadf6b8604b59c9a660dbb371726c12a3666b8 has already been checked
Skipping v1.141.0 because commit 8baadf6b8604b59c9a660dbb371726c12a3666b8 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.142.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.143.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.144.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.145.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.75.0
Skipping v1.76.0 because commit 9102031608aa4154e1c37f557550ec4eabc8780c has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.77.0
Skipping v1.78.0 because commit dcb5d77b420ddee61f58aadd3c2c7aef38778154 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.79.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.80.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.81.0
Skipping v1.82.0 because commit 9e0f3bec26b07b4fb6753a32cb75277f45f2572c has already been checked
Skipping v1.83.0 because commit 9e0f3bec26b07b4fb6753a32cb75277f45f2572c has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.84.0
Skipping v1.84.1 because commit 3daef49297ada205359cc1d2996354c94b628b0d has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.85.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.86.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.87.0
Skipping v1.88.0 because commit 512c0bd97db59c48a5705b2741662a338776e438 has already been checked
Skipping v1.89.0 because commit 512c0bd97db59c48a5705b2741662a338776e438 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.90.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.91.0
Skipping v1.92.0 because commit 2351c5e528cb7430422208dc66707894c066b508 has already been checked
Checking backward compatibility of semgrep_output_v1.atd against past version v1.93.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.94.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.95.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.96.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.97.0
Checking backward compatibility of semgrep_output_v1.atd against past version v1.98.0
Skipping v1.99.0 because commit 60809032a2e39742f42910d46b3e5dd305b8b8cf has already been checked

@gautambhat gautambhat requested a review from bkettle December 1, 2025 18:53
@gautambhat gautambhat force-pushed the gautam/failed-subprojects-in-results-json branch from 35c70a1 to e5d7b41 Compare December 9, 2025 13:42
@gautambhat gautambhat requested review from a team and bkettle and removed request for bkettle December 9, 2025 15:27
: sca_error list
}

type ci_sca_unresolved_subproject = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's already an unresolved_subproject type, so wanted to distinguish this from the other one 👀

Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we reuse that?

Comment on lines +2055 to +2062

?sca_unresolved_subprojects
<doc text="
since semgrep 1.4x.y. (update this once PR merges and is part of a release)
This information is sent to /complete in a different field and structure, but we need to send
it to /results so that it is available when findings are processed (needed to determine issues' state change).
">
: ci_sca_unresolved_subproject list option;
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a little silly to be sending subproject info here and also in the supply_chain_stats. I wonder if we can consolidate them?

Copy link
Contributor

Choose a reason for hiding this comment

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

i.e. can we make this one have all the information that the /complete one has so that we can stop sending to /complete?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's worth thinking about what we want to represent at the conceptual level.

I don't have enough context to be confident here, but my guess is that we'd want one return type that represented something like "the outcome of resolution" (with cases for both successful and failed resolution), and, if we still needed it, supply_chain_stats would only have additional measurements/metrics that could not be derived from looking at the resolution result type. (Which might not be necessary at all—at a first glance, all the fields in subproject_stats are logically describing the outcome of running dependency resolution.)

Copy link
Contributor

Choose a reason for hiding this comment

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

one return type that represented something like "the outcome of resolution"

This is basically what's in subproject_stats, yeah, I think it's just a bit poorly named (it inherited a name from somewhere else IIRC)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I agree it's not optimal, but I was hoping to avoid having to make a swath of changes to the scan completion logic, which also triggers post-completion events that consume the entire stats object (of which supply chain stats is one constituent).

I could move the entirety of ci_scan_complete_stats to /results, but am just a little anxious about unintended or incomplete scan completion behaviour 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the supply chain stats are actually used for anything except storing in S3 (and maybe the DB? Can't remember)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah they're uploaded to S3 with the rest of the stats object (not the DB). I guess stats can be uploaded earlier - I'll play around with this and get back here

Copy link
Member

@squaresurf squaresurf left a comment

Choose a reason for hiding this comment

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

Great work. I'm curious if it would make sense to simplify the data we plan on sending the semgrep-app.

Comment on lines +2056 to +2062
?sca_unresolved_subprojects
<doc text="
since semgrep 1.4x.y. (update this once PR merges and is part of a release)
This information is sent to /complete in a different field and structure, but we need to send
it to /results so that it is available when findings are processed (needed to determine issues' state change).
">
: ci_sca_unresolved_subproject list option;
Copy link
Member

Choose a reason for hiding this comment

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

question: what do you think about changing this to have a default value of an empty list rather than an option? Your semgrep-app PR would be simplified a little by not having to work with a bunch of values that could be None as opposed to being a list of 0 or more.

This comment and the thread as a whole gives some more context on this idea.

Suggested change
?sca_unresolved_subprojects
<doc text="
since semgrep 1.4x.y. (update this once PR merges and is part of a release)
This information is sent to /complete in a different field and structure, but we need to send
it to /results so that it is available when findings are processed (needed to determine issues' state change).
">
: ci_sca_unresolved_subproject list option;
~sca_unresolved_subprojects
<doc text="
since semgrep 1.4x.y. (update this once PR merges and is part of a release)
This information is sent to /complete in a different field and structure, but we need to send
it to /results so that it is available when findings are processed (needed to determine issues' state change).
">
: ci_sca_unresolved_subproject list;

Comment on lines +2056 to +2062
?sca_unresolved_subprojects
<doc text="
since semgrep 1.4x.y. (update this once PR merges and is part of a release)
This information is sent to /complete in a different field and structure, but we need to send
it to /results so that it is available when findings are processed (needed to determine issues' state change).
">
: ci_sca_unresolved_subproject list option;
Copy link
Member

Choose a reason for hiding this comment

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

question: ci_sca_unresolved_subproject contains quite a bit of data. It appears that we are only using a flattened list of filepaths in your semgrep-app PR. Do you foresee us using the other data in the future?

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.

5 participants