Skip to content

fix: make the SPI author line a full sentence - #91

Merged
futamura merged 1 commit into
mainfrom
develop
Aug 21, 2026
Merged

fix: make the SPI author line a full sentence#91
futamura merged 1 commit into
mainfrom
develop

Conversation

@futamura

Copy link
Copy Markdown
Owner

Summary

metadata.authors in .spi.yml was set to Kojiro Futamura and contributors in #89. Reading the Swift Package Index server source shows that value would have rendered as a bare fragment.

Sources/App/Views/PackageController/GetRoute.Model+ext.swift adds the Written by prefix and the full stop only to the line it derives from the commit history:

case .fromSPIManifest(var spiymlAuthors):
    if spiymlAuthors.count > 200 { spiymlAuthors = String(spiymlAuthors.prefix(200)) + "…" }
    return .li(.class("authors"), .text(spiymlAuthors))

case .fromGitRepository(let repositoryAuthors):
    ... listPhrase(opening: "Written by ", nodes: nodes, closing: ".")

So the value has to be a complete sentence. It now reads Written by Kojiro Futamura and contributors., and the comment above it records why. TLDExtractSwift carries the same change.

The page still shows the old derived line, so this lands before the first render rather than correcting it afterwards.

Notes

Sources/App/Controllers/API/API+PackageController+PackageResult.swift reads the manifest from defaultBranchVersion only — a release does not carry the author line forward, which is why 4.0.2 updated the "Latest Release" field but left the author line untouched. SPI's own docs put default-branch .spi.yml changes at up to 24 hours.

Test plan

  • .spi.yml parses as valid YAML; metadata.authors is Written by Kojiro Futamura and contributors. and the file is 1029 bytes, under SPIManifest's 1500 byte limit and the 200 character cap on the authors string.
  • No source changes, so CI is the usual lint + per-platform tests.

SPI only adds the "Written by" prefix and the full stop to the author line
it derives from the commit history. A `metadata.authors` value from
.spi.yml is rendered verbatim, so the previous value would have shown as a
bare fragment next to the other sentences on the package page. The value
now carries the prefix and the full stop itself.

SPI reads this from the default branch only -- the release manifest is not
consulted -- so the change lands whenever SPI next reprocesses main.
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@futamura
futamura merged commit d2a1b47 into main Aug 21, 2026
16 checks passed
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.

1 participant