• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash / 47135491917
89%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 03 Dec 2026 03:15PM UTC
Jobs 1
Files 1294
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Dec 2026 03:10PM UTC coverage: 88.804% (-0.006%) from 88.81%
47135491917

push

github

web-flow
fix: create missing tags when creating a flag

## Issue 

Attempting to create a feature flag (from PUT
`admin/projects/:projectId/features`) with non-existing tags results in
a 500.
The create-flag endpoint (`POST
/api/admin/projects/:projectId/features`) accepts `tags`, but only
attaches them, so an unknown tag hits the foreign key from `feature_tag`
to `tags`.

We should instead allow you to also create new tags along with a new
flag (consistent with the
[documentation](https://docs.getunleash.io/api/create-feature), which
doesn't have any mentions of a restriction to only create a flag with
existing tags).

## The fix 

This adds new tags in the request's transaction. If one tag fails, the
flag, the other tags and their events are rolled back.

- Adds `FeatureTagService.tagNewFeature`, which creates the missing tags
(through the existing `createTagIfNeeded`, in sorted order) and attaches
all tags to the new flag.
- Stores a `tag-created` event for each tag that is created.
- Stores a `feature-tagged` event for each tag attached on creation.
- Returns a 400 that names the tag type when the tag type does not
exist. I don't think we should let you create a new tag type here, as
that requires a specific permission (`CREATE_TAG_TYPE`).

### Follow-up 

The request (and subsequently the documentation) uses the general tag
schema, which includes `color` as a valid property. However, a tag's
color comes from its tag type. A new tag sent with `color` still returns
a 500. I think we should remove it from the schema here. I'll do that in
a follow-up PR.

4336 of 5459 branches covered (79.43%)

18 of 18 new or added lines in 4 files covered. (100.0%)

4 existing lines in 2 files now uncovered.

17251 of 19426 relevant lines covered (88.8%)

847.05 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
83.55
-0.77% src/lib/metrics.ts
1
89.58
-2.08% src/lib/features/frontend-api/client-feature-toggle-read-model.ts
Jobs
ID Job ID Ran Files Coverage
1 47135491917.1 03 Dec 2026 03:15PM UTC 1294
88.8
GitHub Action Run
Source Files on build 47135491917
  • Tree
  • List 1294
  • Changed 7
  • Source Changed 4
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #47135491917
  • 15f14cc0 on github
  • Prev Build on main (#47134897812)
  • Next Build on main (#47297972673)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc