Skip to content

feat: make SpecificationItem fully immutable - #598

Open
bkalika wants to merge 1 commit into
itsallcode:mainfrom
bkalika:572-make-SpecificationItem-immutable
Open

bkalika wants to merge 1 commit into
itsallcode:mainfrom
bkalika:572-make-SpecificationItem-immutable

Conversation

@bkalika

@bkalika bkalika commented Sep 15, 2026

Copy link
Copy Markdown

Closed #572

@kaklakariada kaklakariada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please update PR description to Closes #572
  • Please add an entry to the changelog including your name, so you get the acknowledgement for your contribution


#### Specification Item
`req~specification-item~2`
`req~specification-item~4`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • You didn't update the content of this item.
    • If you plan to update it: please only increment the revision by one
    • If you don't plan to update it: please don't increment the revision

This is an internal refactoring, so updating the spec is not necessary in my view.

Comment thread doc/spec/design.md

#### Specification Item
`dsn~specification-item~3`
`dsn~specification-item~4`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't update the text, see my comment in doc/spec/system_requirements.md

coveringItem.getItem()
.toBuilder()
.addCoveredId(getId())
.build();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't solve the issue. Calling build() will just create a new instance, but you don't do anything with the new instance. To update the coveringItem you need to replace it with the new instance.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @bkalika . But the problem lies a lot deeper and needs more refactoring. I have that on my todo list.

The short version is that we need to distinguish between items and links to avoid mutable objects. With links we will have a append only list. I will fix that at some point, but it's not my priority right now.

@kaklakariada, I think we should close this PR and have an issue ticket for the refactoring instead.

Also, this is not a feature PR.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redcatbear, thanks for the clarification! That makes sense. I understand the deeper refactoring should separate specification items from links and make links append-only. If you already have a design in mind for the bigger refactoring, I’m happy to leave it to you. but if you’d like, I can also try to take a first pass at it now while I already have the code and the problem in context.

@github-project-automation github-project-automation Bot moved this from 📫 Backlog to 🔨 In Progress in OpenFastTrace Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔨 In Progress

Development

Successfully merging this pull request may close these issues.

Make SpecificationItem immutable with toBuilder()

3 participants