Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Please see the [README](README.md#schema) for more documentation on the
YAML Schema.
* Prior to submitting a pull request, run the tests:

* Advisory filename and the root of the `url:` field must
be equal `(as of 5/10/2026).`
```
bundle install
bundle exec rspec
Expand Down
18 changes: 18 additions & 0 deletions spec/advisory_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,24 @@
it { expect(subject).to be_kind_of(String) }
it { expect(subject).to_not match(%r{\Ahttp(s)?://osvdb\.org}) }
it { expect(subject).not_to be_empty }

it "has a filename that matches the root of the url field" do
url = advisory["url"]

# Extract last path segment from URL
url_root = File.basename(URI.parse(url).path)
Comment thread
jasnow marked this conversation as resolved.
Outdated

# Extract filename without extension
Comment thread
jasnow marked this conversation as resolved.
Outdated
filename_root = File.basename(path, ".yml")

# 5/24/2026: May 9, 2026 is earliest start date with no failed checks.
start_date = Date.new(2026, 5, 9)
Comment thread
jasnow marked this conversation as resolved.
# Skip advisories older than start_date and old OSVDB advisories.
Comment thread
jasnow marked this conversation as resolved.
Outdated
if advisory["date"] >= start_date and !filename_root.start_with?("OSVDB")
expect(filename_root).to eq(url_root),
"Expected filename '#{filename_root}' DOES NOT to match URL root '#{url_root}'"
Comment thread
jasnow marked this conversation as resolved.
Outdated
end
end
end

describe "title" do
Expand Down