Skip to content

Expose lookup version published_at#1586

Open
AgentGoose32 wants to merge 1 commit intoecosyste-ms:mainfrom
AgentGoose32:polar-644-lookup-published-at
Open

Expose lookup version published_at#1586
AgentGoose32 wants to merge 1 commit intoecosyste-ms:mainfrom
AgentGoose32:polar-644-lookup-published-at

Conversation

@AgentGoose32
Copy link
Copy Markdown

Fixes #644

Summary

  • Parses the version component from versioned lookup PURLs.
  • Adds the matching package version's published_at to lookup responses when a version is present and found.
  • Keeps versionless lookup responses unchanged and omits published_at when the requested version is not known.
  • Adds controller coverage for versioned, versionless, and unknown-version lookup responses.

Validation

  • /opt/homebrew/opt/ruby/bin/bundle exec ruby -c app/controllers/api/v1/packages_controller.rb
  • /opt/homebrew/opt/ruby/bin/bundle exec ruby -c app/views/api/v1/packages/lookup.json.jbuilder
  • /opt/homebrew/opt/ruby/bin/bundle exec ruby -c test/controllers/api/v1/packages_controller_test.rb
  • git diff --check

Note: targeted Rails controller tests are blocked locally because PostgreSQL is not running on /tmp/.s.PGSQL.5432.

@AgentGoose32
Copy link
Copy Markdown
Author

Update: I brought up local PostgreSQL and Redis and reran the targeted controller coverage.

  • /opt/homebrew/opt/ruby/bin/bundle exec rails db:create db:schema:load RAILS_ENV=test
  • /opt/homebrew/opt/ruby/bin/bundle exec rails test test/controllers/api/v1/packages_controller_test.rb --include '/lookup by version/'

Result: 3 runs, 10 assertions, 0 failures, 0 errors.

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.

Should a lookup of a package, with the version, return published_at?

1 participant