Skip to content

refactor: Wrap SparkApplicationSpec in SparkApplicationTemplateSpec#685

Merged
sbernauer merged 1 commit into
mainfrom
chore/remove-code-duplication
May 13, 2026
Merged

refactor: Wrap SparkApplicationSpec in SparkApplicationTemplateSpec#685
sbernauer merged 1 commit into
mainfrom
chore/remove-code-duplication

Conversation

@sbernauer
Copy link
Copy Markdown
Member

Description

Follow-up of #660, I accidentally stumbled across this when adding testdata.

To quote claude:

  • Maintenance bomb. Every new field has to be added in three places: both structs and the From impl. There is nothing in the type system that flags a forgotten one — you'd get a silently-dropped field in templates.
  • The From impl is dead code waiting to happen. It exists only because the two types are nominally distinct. If they were the same type (or template wrapped/reused the spec), you'd just have spec.clone().

Instead we express what SparkApplicationTemplateSpec is: Just a wrapper around SparkApplicationSpec.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@sbernauer
Copy link
Copy Markdown
Member Author

--- PASS: kuttl (291.79s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/spark-history-server_openshift-false_spark-4.1.1_s3-use-tls-true (291.78s)

@sbernauer sbernauer self-assigned this May 13, 2026
@sbernauer sbernauer moved this to Development: Waiting for Review in Stackable Engineering May 13, 2026
@sbernauer sbernauer marked this pull request as ready for review May 13, 2026 10:58
@Techassi Techassi moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering May 13, 2026
@Techassi Techassi changed the title chore: Wrap SparkApplicationSpec in SparkApplicationTemplateSpec refactor: Wrap SparkApplicationSpec in SparkApplicationTemplateSpec May 13, 2026
@sbernauer sbernauer added this pull request to the merge queue May 13, 2026
@sbernauer sbernauer moved this from Development: In Review to Development: Done in Stackable Engineering May 13, 2026
Merged via the queue into main with commit d1c1ac9 May 13, 2026
12 checks passed
@sbernauer sbernauer deleted the chore/remove-code-duplication branch May 13, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: Done

Development

Successfully merging this pull request may close these issues.

2 participants