Skip to content

Commit

Permalink
Autodetect version tags
Browse files Browse the repository at this point in the history
Towards coreinfrastructure#2139. Still draft because it needs updates to the
unit tests (/VCR) but I ran into problems with the chrome
integration of the tests.

Signed-off-by: Arnout Engelen <[email protected]>
  • Loading branch information
raboof committed Jun 20, 2024
1 parent a848094 commit df7c2c5
Show file tree
Hide file tree
Showing 6 changed files with 491 additions and 8 deletions.
12 changes: 12 additions & 0 deletions app/lib/github_basic_detective.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class GithubBasicDetective < Detective
OUTPUTS = %i[
name license discussion_status repo_public_status repo_track_status
repo_distributed_status contribution_status implementation_languages
version_tags
].freeze

# These are the 'correct' display case for SPDX for OSI-approved licenses.
Expand Down Expand Up @@ -170,6 +171,17 @@ def analyze(_evidence, current)
confidence: 3,
explanation: 'GitHub API implementation language analysis'
}

# Check for tags
tag_data = client.tags fullname
tags = tag_data.map { |tag| tag[:name] }.sort
if tags.any? { |tag| tag.match?(/^v?\d+\.\d+\.\d+$/) }
results[:version_tags] = {
value: tags,
confidence: 2,
explanation: 'GitHub tags'
}
end
end

results
Expand Down
Loading

0 comments on commit df7c2c5

Please sign in to comment.