File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,13 +190,13 @@ def manifests
190190
191191 # Returns a synopsis of the scan performed in the format `ecosystem::manifest_path`, e.g.
192192 # - `golang::/`
193- # - `rubygems::rails_app/`
193+ # - `rubygems::/ rails_app/`
194194 #
195195 sig do
196196 returns ( String )
197197 end
198198 def scanned_manifest_path
199- "#{ GithubApi ::EcosystemMapper . ecosystem_for ( package_manager ) } ::#{ File . dirname ( manifest_file . path ) } "
199+ "#{ GithubApi ::EcosystemMapper . ecosystem_for ( package_manager ) } ::#{ manifest_file . directory } "
200200 end
201201 end
202202end
Original file line number Diff line number Diff line change 419419 # We should have metadata indicating a successful snapshot
420420 expect ( payload [ :metadata ] [ :status ] ) . to eql ( GithubApi ::DependencySubmission ::SnapshotStatus ::SUCCESS . serialize )
421421 expect ( payload [ :metadata ] [ :reason ] ) . to be_nil
422- expect ( payload [ :metadata ] [ :scanned_manifest_path ] ) . to eql ( "rubygems::/subproject" )
422+ expect ( payload [ :metadata ] [ :scanned_manifest_path ] ) . to eql ( "rubygems::/subproject/ " )
423423 end
424424 end
425425 end
566566 end
567567 end
568568
569+ context "with non-existent dependency files in a subpath" do
570+ let ( :directories ) { [ directory ] }
571+ let ( :directory ) { "/subproject/" }
572+ let ( :repo_contents_path ) { build_tmp_repo ( "bundler/original" , path : "" ) }
573+
574+ let ( :dependency_files ) do
575+ [ ]
576+ end
577+
578+ it "generates an empty snapshot with metadata" do
579+ expect ( service ) . to receive ( :create_dependency_submission ) do |args |
580+ payload = args [ :dependency_submission ] . payload
581+
582+ expect ( payload [ :job ] [ :correlator ] ) . to eq ( "dependabot-bundler-subproject" )
583+ expect ( payload [ :manifests ] ) . to be_empty
584+
585+ # It should contain the expected metadata
586+ expect ( payload [ :metadata ] [ :status ] ) . to eq ( GithubApi ::DependencySubmission ::SnapshotStatus ::SKIPPED . serialize )
587+ expect ( payload [ :metadata ] [ :reason ] ) . to eq ( GithubApi ::DependencySubmission ::EMPTY_REASON_NO_MANIFESTS )
588+ expect ( payload [ :metadata ] [ :scanned_manifest_path ] ) . to eql ( "rubygems::/subproject/" )
589+ end
590+
591+ update_graph_processor . run
592+ end
593+ end
594+
569595 describe "job validation" do
570596 let ( :dependency_files ) do
571597 [
You can’t perform that action at this time.
0 commit comments