Skip to content

Conversation

@michaelphamcf
Copy link
Contributor

@michaelphamcf michaelphamcf commented Jul 2, 2025

Summary

JIRA: DX-202

Updates existing entry.get method to handle releaseId that is passed in. This is for plain client.

Description

If releaseId is passed in to entry.get, a query param is added to the entry get endpoint to fetch a release entry.

Motivation and Context

Checklist (check all before merging)

  • Both unit and integration tests are passing
  • There are no breaking changes
  • Changes are reflected in the documentation

When adding a new method:

  • The new method is exported through the default and plain CMA client
  • All new public types are exported from ./lib/export-types.ts
  • Added a unit test for the new method
  • Added an integration test for the new method
  • The new method is added to the documentation

@michaelphamcf michaelphamcf marked this pull request as ready for review July 2, 2025 22:53
@michaelphamcf michaelphamcf requested a review from a team as a code owner July 2, 2025 22:53
@michaelphamcf michaelphamcf changed the title Dx 202 update entry get method to pass in release DX-202 Update entry.get to pass in releaseId Jul 2, 2025
Copy link
Contributor

@elylucas elylucas left a comment

Choose a reason for hiding this comment

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

Let one small nitpick, feel free to do with as you wish, besides that 🚀

rawData?: unknown,
headers?: RawAxiosRequestHeaders
) => {
const releaseId = params.releaseId ?? undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could do const releaseId = params.releaseId; here instead of using the null coalescing operator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Saw that releaseId wasn't referenced much, so cleaned it up a bit more, removing that variable assignment.

@michaelphamcf michaelphamcf merged commit aa4a487 into release/releasesv2 Jul 3, 2025
6 checks passed
@michaelphamcf michaelphamcf deleted the DX-202-update-entry-get-method-to-pass-in-release-id branch July 3, 2025 17:28
@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 11.55.0-canary.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 11.58.0-canary.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 11.59.0-canary.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

whitelisab added a commit that referenced this pull request Sep 24, 2025
* feat: add releaseSchema defaults to plain client creation [DX-184] (#2664)

* feat: add releaseSchema defaults to plain client creation

* fix: rename releaseSchema to releaseSchemaVersion

* fix: forgot to fix test

* feat(default): release-id (#2666)

* feat: add support for releaseSchemaVersion in create/query methods [DX-187] (#2665)

* feat: add releaseSchema defaults to plain client creation

* fix: rename releaseSchema to releaseSchemaVersion

* fix: forgot to fix test

* feat: add support for releaseSchemaVersion in create/query methods

* chore: lint fixes

* feat: add support for release.entry.* pattern

* chore: lint fixes

* chore: fix test description

* feat: add support for release.entry.* pattern [DX-192] (#2667)

* feat: add releaseSchema defaults to plain client creation

* fix: rename releaseSchema to releaseSchemaVersion

* fix: forgot to fix test

* feat: add support for releaseSchemaVersion in create/query methods

* chore: lint fixes

* feat: add support for release.entry.* pattern

* chore: lint fix

* chore: removing duplicate type

* feat: release/update endpoint reflects schemaVersion param [DX-188] (#2668)

* feat: add releaseSchema defaults to plain client creation

* fix: rename releaseSchema to releaseSchemaVersion

* fix: forgot to fix test

* feat: add support for releaseSchemaVersion in create/query methods

* chore: lint fixes

* feat: add support for release.entry.* pattern

* chore: lint fixes

* feat: add forTemplatedSpaces field for env template creation [DX-173] (#2663)

* chore: GetReleaseParams now extends GetReleaseEnvironmentParams

* feat: release/update enpoint updated to reflect Release.v2

* chore: removed unnecessary error handling from update endpoint

* chore: default integration test implemented

* chore: withoutDefault integration test implemented

* feat: all integrations tests passing

* fix: test:integration-watch action in package.json reverted to default

* fix: lint error resolved

* fix: prettier passing

---------

Co-authored-by: Ely Lucas <ely@meta-tek.net>
Co-authored-by: Lisa White <lisa.white@contentful.com>

* Dx 194 Add unit tests for release.entry.get (#2674)

* add unit tests and mock for ReleaseEntry

* update test to use it.each

* Remove wrapper tests; move Rest endpoint tests to proper directory

* fix: lint prettier

* feat(releases): release.entry.getMany() (#2673)

* DX-202 Update entry.get to pass in releaseId (#2679)

* feat: entry.get takes releaseId from params to retrieve release entry

* add tests

* chore:prettier

* chore:prettier again

* chore: move entry w/ releaseId tests to existing entry integration tests file

* chore: cleanup comment, remove QueryParam that was added unnecessarily

* chore: cleanup code

* feat: update entry.getMany to include releasev2 params [DX-203] (#2685)

* chore: getMany first attempt

* chore: new integrations test file added (from Michael)

* chore: type fixes implemented

* chore: test shell added to entry-integration.test.ts

* chore: tests implemented with necessary unimplemented release metadata tests commented out

* chore: prettier fix

* fix: entry integration scope removed from test script

* chore: prettier fix

* fix: version logic cleaned up and test query modified

* chore: prettier fix

* feat: add release.entry.update method [DX-206] (#2692)

* feat: add release.entry.update method

* feat: add entry.release.patch method (#2695)

* fix: delete entry2 as part of entry integration test cleanup [DX-258] (#2700)

* chore: add canary build to release/releasev2 branch [DX-212] (#2696)

* chore: add canary build to release/releasev2 branch

* chore: update readme with info on current experimental features

* chore: creating canary branch for canary prerelease builds

* chore: add canary branch to release process in ci config

* feat: add release.entry.createWithId method [DX-61] (#2724)

* feat: add release.entry.createWithId method [DX-61]

* fix: update types for release entry params

* test: debug integration tests

* test: update unit tests and remove changes to integration tests

* feat: entry.patch handle releaseId [DX-209] (#2725)

* feat: entry.patch w/ releaseId alias for release.entry.patch

* chore: add unit tests

* chore: run prettier

* chore: add integration tests for entry.patch with releaseId

* chore: run lint

* chore: cleanup code

* chore: more cleanup

* chore(test): remove redundant assertion

* chore: cleanup params, console logs

* chore: handle undefined headers for typescript

* chore: use typecasting to pass param

* feat: update entry.createWithId to accept releaseId [DX-208] (#2727)

* feat: entry.update supports releaseId [DX-210] (#2728)

* feat: entry.update supports releaseId

* chore: add unit tests for entry.update

* chore: use typecasting to pass param

* test: add integration tests for entry.update

* chore: keep QueryParams consistent between entry.update and release.entry.update

* feat: add release.entry.create method (#2730)

* feat: entry.create supports releaseId [DX-207] (#2732)

* feat: add releaseId support to entry.create

* chore: add QueryParams to be consistent with release.entry.create

* fix: remove startDate from releasev2 payload [DX-380] (#2739)

* feat: remove release[lte] endpoint [TOL-3408] (#2747)

* feat: remove release[lte] endpoint

* fix: delete more old tests, fix return types

* fix(types): add release to entitymetasysprops [] (#2749)

* feat: add support for release asset endpoints [TOL-3357] (#2750)

* fix(types): add release to entitymetasysprops []

* feat(release-assets): add support for assets inside of a release [TOL-3357]

* fix(types): export ReleasePaylodV2 [] (#2754)

* fix: update types, add tests, and cleanup [DX-397] (#2755)

* chore: update experimental features in readme

---------

Co-authored-by: Ely Lucas <ely@meta-tek.net>
Co-authored-by: ethan ozelius <158083968+ethan-ozelius-contentful@users.noreply.github.com>
Co-authored-by: Tyler Pina <tyler.pina@contentful.com>
Co-authored-by: Michael Pham <michael.pham@contentful.com>
Co-authored-by: MayaGillilan <101652314+MayaGillilan@users.noreply.github.com>
Co-authored-by: Chris Helgert <chrishelgert@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants