Skip to content

chore: Merge branch 'v0.54' into main#3656

Merged
edgarrmondragon merged 7 commits into
mainfrom
merge-v054
May 28, 2026
Merged

chore: Merge branch 'v0.54' into main#3656
edgarrmondragon merged 7 commits into
mainfrom
merge-v054

Conversation

@edgarrmondragon
Copy link
Copy Markdown
Collaborator

@edgarrmondragon edgarrmondragon commented May 28, 2026

SSIA

Summary by Sourcery

Honor stream map aliases when emitting ACTIVATE_VERSION messages and bump the SDK version to 0.54.4.

Bug Fixes:

  • Ensure emitted ACTIVATE_VERSION messages use the correct stream aliases defined by stream maps and skip removed-record transforms.

Enhancements:

  • Update tap/target/mapper templates, documentation, and metadata to reference SDK version 0.54.4.

Tests:

  • Adjust mapped stream tests to run with ACTIVATE_VERSION emission enabled and refresh corresponding snapshots.

edgarrmondragon and others added 5 commits May 27, 2026 15:31
…ON forces _sdc metadata columns (#3650)

SSIA

## Summary by Sourcery

Bug Fixes:
- Include the stream name in the log message emitted when
ACTIVATE_VERSION forces _sdc metadata columns to be added.

---------

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Prepare MeltanoSDK `v0.54.3` for release.

Checklist:

- [x] Check that the right version is set in all the files.
- [x] Groom the changelog for wording or missing entries.
- [ ] Merge this PR once everything looks good.

[Release
Draft](https://github.com/meltano/sdk/releases/tag/untagged-7e449f29d1fdd9b4737f)

## Summary by Sourcery

Prepare the 0.54.3 release of the Meltano SDK.

Bug Fixes:
- Document a fix ensuring stream names are included in log messages when
ACTIVATE_VERSION forces _sdc metadata columns.

Enhancements:
- Bump SDK version references from 0.54.2 to 0.54.3 across project
configuration, templates, and documentation metadata.

---------

Co-authored-by: edgarrmondragon <16805946+edgarrmondragon@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ed with stream maps (#3654)

SSIA

## Summary by Sourcery

Ensure ACTIVATE_VERSION messages emitted by mapped streams respect
configured stream aliases instead of always using the original stream
name.

Bug Fixes:
- Fix ACTIVATE_VERSION emission to use each stream map alias and skip
mappings that remove records.

Tests:
- Enable ACTIVATE_VERSION message emission in mapped stream tests and
update JSONL snapshots to validate correct behavior with stream aliases.

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Prepare MeltanoSDK `v0.54.4` for release.

Checklist:

- [x] Check that the right version is set in all the files.
- [x] Groom the changelog for wording or missing entries.
- [x] Merge this PR once everything looks good.

[Release
Draft](https://github.com/meltano/sdk/releases/tag/untagged-5c952353a22391e5f9eb)

## Summary by Sourcery

Release version 0.54.4 of the SDK and update references across the
project.

Bug Fixes:
- Ensure emitted ACTIVATE_VERSION messages respect stream aliases
configured via stream maps.

Build:
- Bump singer-sdk dependency to v0.54.4 in all cookiecutter templates
and project metadata.

Documentation:
- Update changelog with v0.54.4 entry and adjust documentation config
and templates to reference the new version.

---------

Co-authored-by: edgarrmondragon <16805946+edgarrmondragon@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@edgarrmondragon edgarrmondragon requested a review from a team as a code owner May 28, 2026 19:55
@edgarrmondragon edgarrmondragon self-assigned this May 28, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 28, 2026

Reviewer's Guide

Adjusts ACTIVATE_VERSION emission to respect stream map aliases while skipping removed streams, updates mapped stream tests and snapshots accordingly, and bumps the SDK and templates to version 0.54.4 with associated docs and metadata tweaks.

Sequence diagram for ACTIVATE_VERSION emission with stream map aliases

sequenceDiagram
    participant Tap as Tap
    participant Stream as Stream
    participant StreamMap as StreamMap

    Tap->>Stream: _write_activate_version_message(full_table_version)
    loop stream_maps
        Stream->>StreamMap: access stream_alias
        alt [stream_map is RemoveRecordTransform]
            Stream-->>StreamMap: skip
        else [stream_map is not RemoveRecordTransform]
            Stream->>Tap: write_message(ActivateVersionMessage(stream_alias, full_table_version))
        end
    end
Loading

File-Level Changes

Change Details Files
Emit ACTIVATE_VERSION messages per mapped stream using stream aliases instead of the base stream name, skipping removed-record transforms.
  • Replace single global ACTIVATE_VERSION emit with a loop over configured stream maps
  • Skip emitting ACTIVATE_VERSION for RemoveRecordTransform mappings
  • Use the tap instance’s write_message method instead of the module-level singer.write_message
  • Set stream value on ActivateVersionMessage to the stream map’s stream_alias
singer_sdk/streams/core.py
Ensure mapper tests exercise ACTIVATE_VERSION behavior and update expected outputs for mapped/aliased streams.
  • Enable emit_activate_version_messages in MappedTap configuration within mapped_stream test
  • Refresh mapped_stream snapshot files to match new ACTIVATE_VERSION emission semantics
tests/core/test_mapper.py
tests/snapshots/mapped_stream/aliased_stream.jsonl
tests/snapshots/mapped_stream/aliased_stream_batch.jsonl
tests/snapshots/mapped_stream/aliased_stream_not_expr.jsonl
tests/snapshots/mapped_stream/aliased_stream_quoted.jsonl
tests/snapshots/mapped_stream/builtin_variable_original_stream_name_alias.jsonl
tests/snapshots/mapped_stream/builtin_variable_original_stream_name_no_alias.jsonl
tests/snapshots/mapped_stream/builtin_variable_self.jsonl
tests/snapshots/mapped_stream/builtin_variable_stream_name.jsonl
tests/snapshots/mapped_stream/builtin_variable_stream_name_alias.jsonl
tests/snapshots/mapped_stream/builtin_variable_stream_name_alias_expr.jsonl
tests/snapshots/mapped_stream/builtin_variable_underscore.jsonl
tests/snapshots/mapped_stream/changed_key_properties.jsonl
tests/snapshots/mapped_stream/dates.jsonl
tests/snapshots/mapped_stream/drop_property.jsonl
tests/snapshots/mapped_stream/drop_property_null_string.jsonl
tests/snapshots/mapped_stream/fake_credit_card_number.jsonl
tests/snapshots/mapped_stream/fake_email_seed_instance.jsonl
tests/snapshots/mapped_stream/filter_records.jsonl
tests/snapshots/mapped_stream/filter_records_cast_to_bool.jsonl
tests/snapshots/mapped_stream/flatten_all.jsonl
tests/snapshots/mapped_stream/flatten_all_with_dot_separator.jsonl
tests/snapshots/mapped_stream/flatten_depth_0.jsonl
tests/snapshots/mapped_stream/flatten_depth_1.jsonl
tests/snapshots/mapped_stream/json_dumps.jsonl
tests/snapshots/mapped_stream/keep_all_fields.jsonl
tests/snapshots/mapped_stream/map_and_flatten.jsonl
tests/snapshots/mapped_stream/no_map.jsonl
tests/snapshots/mapped_stream/non_pk_passthrough.jsonl
tests/snapshots/mapped_stream/only_mapped_fields.jsonl
tests/snapshots/mapped_stream/only_mapped_fields_null_string.jsonl
tests/snapshots/mapped_stream/record_to_column.jsonl
tests/snapshots/mapped_stream/sourced_stream_1.jsonl
tests/snapshots/mapped_stream/sourced_stream_1_null_string.jsonl
tests/snapshots/mapped_stream/sourced_stream_2.jsonl
Bump project/version metadata to 0.54.4 and document the ACTIVATE_VERSION alias fix.
  • Add v0.54.4 entry to CHANGELOG documenting ACTIVATE_VERSION alias behavior fix
  • Update SDK version in pyproject and docs release string
  • Update cookiecutter tap/target/mapper templates to depend on singer-sdk 0.54.4
  • Adjust GitHub bug report template SDK version placeholder
CHANGELOG.md
pyproject.toml
.github/ISSUE_TEMPLATE/bug.yml
docs/conf.py
cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml
cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml
cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • In _write_activate_version_message, consider preserving the previous behavior for unmapped streams (e.g., when self.stream_maps is empty) so that a non-mapped stream still emits an ACTIVATE_VERSION message for self.name rather than silently emitting nothing.
  • Now that ACTIVATE_VERSION goes through self._tap.write_message instead of singer.write_message, double-check whether this path should also be used (or abstracted) for other message types for consistency, or if there are cases where a direct singer.write_message should still be used.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `_write_activate_version_message`, consider preserving the previous behavior for unmapped streams (e.g., when `self.stream_maps` is empty) so that a non-mapped stream still emits an `ACTIVATE_VERSION` message for `self.name` rather than silently emitting nothing.
- Now that `ACTIVATE_VERSION` goes through `self._tap.write_message` instead of `singer.write_message`, double-check whether this path should also be used (or abstracted) for other message types for consistency, or if there are cases where a direct `singer.write_message` should still be used.

## Individual Comments

### Comment 1
<location path="singer_sdk/streams/core.py" line_range="858-869" />
<code_context>
-            singer.ActivateVersionMessage(
-                stream=self.name,
-                version=full_table_version,
+        for stream_map in self.stream_maps:
+            if isinstance(stream_map, RemoveRecordTransform):
+                continue
+
+            self._tap.write_message(
+                singer.ActivateVersionMessage(
+                    stream=stream_map.stream_alias,
+                    version=full_table_version,
+                )
             )
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Consider deduplicating stream aliases before emitting ACTIVATE_VERSION messages.

Because multiple entries in `self.stream_maps` can share a `stream_alias`, this loop may now emit several `ActivateVersionMessage`s for the same logical stream, unlike the previous one-per-stream behavior. To avoid confusing downstream consumers or bloating the state log, consider deduplicating aliases (e.g., track them in a `set`) and emit a single activate message per unique alias.

```suggestion
    def _write_activate_version_message(self, full_table_version: int) -> None:
        """Write out an ACTIVATE_VERSION message."""
        seen_aliases: set[str] = set()

        for stream_map in self.stream_maps:
            if isinstance(stream_map, RemoveRecordTransform):
                continue

            stream_alias = stream_map.stream_alias
            if stream_alias in seen_aliases:
                continue

            seen_aliases.add(stream_alias)

            self._tap.write_message(
                singer.ActivateVersionMessage(
                    stream=stream_alias,
                    version=full_table_version,
                )
            )
```
</issue_to_address>

### Comment 2
<location path="CHANGELOG.md" line_range="18" />
<code_context>
 ### 🐛 Fixes

-- [#3650](https://github.com/meltano/sdk/issues/3650) Ensure stream name is included in log message when ACTIVATE_VERSION forces \_sdc metadata columns.
+- [#3650](https://github.com/meltano/sdk/issues/3650) Ensure stream name is include in log message when ACTIVATE_VERSION forces \_sdc metadata columns

 ## v0.54.2 (2026-05-18)
</code_context>
<issue_to_address>
**issue (typo):** Typo: use "included" instead of "include".

Update the text to: `Ensure stream name is included in log message when ACTIVATE_VERSION forces _sdc metadata columns`.

```suggestion
- [#3650](https://github.com/meltano/sdk/issues/3650) Ensure stream name is included in log message when ACTIVATE_VERSION forces _sdc metadata columns
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread singer_sdk/streams/core.py
Comment thread CHANGELOG.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.90%. Comparing base (aceb0e0) to head (353713f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3656   +/-   ##
=======================================
  Coverage   93.89%   93.90%           
=======================================
  Files          73       73           
  Lines        5949     5952    +3     
  Branches      728      730    +2     
=======================================
+ Hits         5586     5589    +3     
  Misses        270      270           
  Partials       93       93           
Flag Coverage Δ
core 82.64% <100.00%> (+<0.01%) ⬆️
end-to-end 75.23% <50.00%> (-0.03%) ⬇️
optional-components 42.75% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

edgarrmondragon and others added 2 commits May 28, 2026 13:58
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 28, 2026

Merging this PR will not alter performance

✅ 8 untouched benchmarks


Comparing merge-v054 (353713f) with main (aceb0e0)

Open in CodSpeed

@edgarrmondragon edgarrmondragon merged commit f291961 into main May 28, 2026
41 of 42 checks passed
@edgarrmondragon edgarrmondragon deleted the merge-v054 branch May 28, 2026 20:13
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