Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependabot core issue npe composer fileparser #9643

Merged
merged 25 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3df7ef0
Issue 5919 - added check for nil in file parser. fileparser.spec is …
GarryHurleyJr Apr 29, 2024
0e246cd
issue #5919 - cleaning up test code
GarryHurleyJr Apr 29, 2024
2cc20e4
issue #5919 - cleaning up test code error
GarryHurleyJr Apr 29, 2024
85f669a
issue #5919 - cleaning up test code error
GarryHurleyJr Apr 29, 2024
95bbce0
Issue 5919 - added check for nil in file parser. fileparser.spec is …
GarryHurleyJr Apr 29, 2024
81a0a45
issue #5919 - cleaning up test code
GarryHurleyJr Apr 29, 2024
c344e7d
issue #5919 - cleaning up test code error
GarryHurleyJr Apr 29, 2024
e0894f2
issue #5919 - cleaning up test code error
GarryHurleyJr Apr 29, 2024
01ffa13
Merge branch 'dependabot-core-issue-npe-composer-fileparser' of https…
GarryHurleyJr Apr 29, 2024
f6de867
issue #5919 - cleaning up Lint issues
GarryHurleyJr Apr 29, 2024
269af04
Issue #9634 - cleaned up code to remove overthought solution.
GarryHurleyJr Apr 30, 2024
34667ad
Issue #9643 - cleaned up lint issues in code.
GarryHurleyJr Apr 30, 2024
2ff1e72
Issue #9643 - cleaned up lint issues in code.
GarryHurleyJr Apr 30, 2024
39f2e62
Issue #9643 - cleaned up lint issues in code.
GarryHurleyJr Apr 30, 2024
006fa52
Issue #9643 - cleaned up lint issues in code.
GarryHurleyJr Apr 30, 2024
4552769
Merge branch 'main' into dependabot-core-issue-npe-composer-fileparser
GarryHurleyJr May 1, 2024
3af7bb0
Merge branch 'main' into dependabot-core-issue-npe-composer-fileparser
GarryHurleyJr May 2, 2024
9a82d69
Issue #9643 created test and changed code to make sure NPE no longer …
GarryHurleyJr May 3, 2024
707e101
Issue #9643 resolved lint issues
GarryHurleyJr May 3, 2024
9c02dc8
Merge branch 'main' into dependabot-core-issue-npe-composer-fileparser
GarryHurleyJr May 3, 2024
13f7f15
Issue #5919 - code review feedback changes
GarryHurleyJr May 3, 2024
2febbd3
Merge branch 'dependabot-core-issue-npe-composer-fileparser' of https…
GarryHurleyJr May 3, 2024
80c2a7a
Merge branch 'main' into dependabot-core-issue-npe-composer-fileparser
GarryHurleyJr May 3, 2024
e4376a2
Merge branch 'main' into dependabot-core-issue-npe-composer-fileparser
GarryHurleyJr May 3, 2024
d322cd2
Merge branch 'main' into dependabot-core-issue-npe-composer-fileparser
GarryHurleyJr May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer/lib/dependabot/composer/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def git_dependency_details(package_details, requirement)

def lockfile_details(name:, type:)
key = lockfile_key(type)
parsed_lockfile.fetch(key, []).find { |d| d["name"] == name }
parsed_lockfile.fetch(key, [])&.find { |d| d["name"] == name }
end

def lockfile_key(type)
Expand Down
10 changes: 10 additions & 0 deletions composer/spec/dependabot/composer/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
end
end

context "null dependencies with lockfile" do
let(:project_name) { "null_dependencies_with_lockfile" }
let(:name) { "phpunit/phpunit" }
let(:type) { "development" }
describe "no dependencies" do
subject { dependencies }
its(:length) { is_expected.to be >= 0 }
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind adding a link to the bug/issue this is addressing somewhere? I understand what this test is doing but I'm not sure what behavior it's trying to fix/verify.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey Bryan,
The issue is #5919

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

end
end

context "with a version specified (composer v1)" do
let(:project_name) { "v1/minor_version" }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "joshuaestes/server-tools",
"description": "Collection of command line tools to help with server management and maintenance",
"keywords": [],
"homepage": "https://github.com/JoshuaEstes/ServerTools",
"license": "MIT",
"authors": [
{
"name": "Joshua Estes",
"homepage": "http://joshuaestes.me"
},
{
"name": "Contributors",
"homepage": "https://github.com/JoshuaEstes/ServerTools/graphs/contributors"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.3.2",
"symfony/console": ">=2.1,<=2.3@dev",
"symfony/process": ">=2.1,<=2.3@dev",
"symfony/yaml": ">=2.1,<=2.3@dev",
"symfony/finder": ">=2.1,<=2.3@dev",
"symfony/filesystem": ">=2.1,<=2.3@dev"
},
"replace": {
"JoshuaEstes/ServerTools": "self.version"
},
"require-dev": {
"phpunit/phpunit": "*",
"mikey179/vfsStream": "*"
},
"autoload": {
"psr-0": { "": "src/" }
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.