Skip to content

PNE-9649: Replace ProcessTemplate allowed_names with a warning shim - #242

Open
wjohnald wants to merge 6 commits into
mainfrom
feature/PNE-9649-deprecate-allowed-names
Open

wjohnald wants to merge 6 commits into
mainfrom
feature/PNE-9649-deprecate-allowed-names

Conversation

@wjohnald

@wjohnald wjohnald commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GEMD Python PR

Description

The Citrine Platform ignores allowed_names on process templates. It finds ingredient names from the ingredient specs. Epic PNE-9643 drops the field.

This PR stops GEMD Python from storing or serializing allowed_names. ProcessTemplate accepts the name, so existing code runs. Each use warns the caller to remove it.

With this PR, ProcessTemplate behaves this way:

  • The constructor accepts allowed_names and discards the value.
  • Assigning to the allowed_names property discards the value.
  • Reading the property returns an empty list.
  • as_dict() and the JSON output leave the field out.
  • JSON that has the field loads, and the loader discards the value.

Each of these uses of allowed_names emits a DeprecationWarning:

  • Passing the argument to the constructor, even as an empty list.
  • Assigning to the property, with any value.
  • Reading the property.
  • Loading JSON that has the field. Older dumps always have it.

The warning reads: "allowed_names is deprecated as of 3.1.0 and will be removed in 4.0.0. GEMD Python discards the value, and the Citrine Platform ignores it."

The getter and setter have @deprecated decorators with removed_in="4.0.0". The CI deprecation check fails once the version reaches 4.0.0, so the shim must be deleted in that release.

Code that reads the property gets an empty list in place of the stored names. Every other call keeps working, so the version goes to 3.1.0. That version satisfies the gemd>=3,<4 pin in citrine-python.

This PR also removes allowed_names from the cake demo.

Run the checks in CONTRIBUTING.md to test it.

PR Type:

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance (non-breaking change to assist developers)

Adherence to team decisions

  • I have added tests for 100% coverage
  • I have written Numpy-style docstrings for every method and class.
  • I have communicated the downstream consequences of the PR to others.
  • I have bumped the version in __version__.py

🤖 Generated with Claude Code

wjohnald and others added 2 commits November 12, 2026 09:14
Setting a non-empty allowed_names now emits a DeprecationWarning. The
Citrine Platform ignores the field, and it will be removed in 4.0.0.
The constructor argument, property, and JSON round-trip still work.
The cake demo no longer sets the field. Bump the version to 3.1.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Citrine Platform no longer uses process-template allowed_names.
Remove the constructor argument, the property, and the deprecation
warning, along with their tests. JSON that still has the field loads,
and the loader logs that it ignores the unexpected key. Bump the
version to 4.0.0 for the breaking change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wjohnald wjohnald changed the title PNE-9649: Deprecate allowed_names on ProcessTemplate PNE-9649: Remove allowed_names from ProcessTemplate Nov 12, 2026
@wjohnald
wjohnald marked this pull request as ready for review November 12, 2026 14:22
@wjohnald
wjohnald requested a review from kroenlein November 12, 2026 14:22
@kroenlein

Copy link
Copy Markdown
Collaborator

Delete the attribute here would break all existing pipelines. I would much rather have a deprecation on 4.0 (which I was presuming would be dropping python 3.10 support) and then removal in 5.0. We'd presumably include a message about setting the attribute having no effect in the deprecation.

@wjohnald

Copy link
Copy Markdown
Contributor Author

@kroenlein , in what specific ways will it break existing pipelines? Do they import gemd-python independently of citrine-python?

Nothing in citrine-python actually reads the field outside of the serde tests.

I could upgrade citrine-python to drop the field altogether first.

But again, I'm not sure how holding this change prevents the pipelines from breaking.

@wjohnald

Copy link
Copy Markdown
Contributor Author

@kroenlein, as an experiment, here is a run of the tests on a branch of citrine-python where I actively stripped the allowed_names field.

branch: CitrineInformatics/citrine-python#1076
e2e run: https://github.com/CitrineInformatics/nextgen-devkit/actions/runs/43727014025

@wjohnald

Copy link
Copy Markdown
Contributor Author

The backend is now completely ignoring these fields.

I don't see why we need a prolonged deprecation cycle for this.

I have removed the field and updated the major version to indicate a breaking change.

If a calcite or lazurite files an issue via SPT, I will simply respond by telling them to pin the version at 5.x until they update their client code.

wjohnald and others added 2 commits November 18, 2026 12:05
ProcessTemplate accepts allowed_names again, so existing code does not
raise. The constructor argument, the setter, and the getter each emit a
DeprecationWarning that says the field has been removed. The template
stores no value, and the field stays out of as_dict() and the JSON.
JSON that has the field loads with the same warning.

Set the version to 3.1.0, because the change no longer breaks the API.

Co-Authored-By: Claude <noreply@anthropic.com>
@wjohnald wjohnald changed the title PNE-9649: Remove allowed_names from ProcessTemplate PNE-9649: Replace ProcessTemplate allowed_names with a warning shim Nov 19, 2026
One test covers the constructor, setter, and getter warnings, which
keeps the shim at 100% coverage.

Co-Authored-By: Claude <noreply@anthropic.com>
The getter and setter carry @deprecated with removed_in="4.0.0", so the
CI deprecation check fails once the version reaches 4.0.0. The
constructor emits the same DeprecatedWarning when a caller passes the
argument.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants