Skip to content

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Oct 3, 2025

See matrix-org/synapse#12973 where we previously used version_string="Synapse/" + get_distribution_version_string("matrix-synapse") everywhere; and then updated to use version_string=f"Synapse/{SYNAPSE_VERSION}" for every other place except synapse/app/homeserver.py (why?!?!?!). This seems more like a typo than something on purpose especially without any context in the comments or PR. The whole point of that PR was trying to solve the missing git info in version strings.

For reference, here is what both variables look like for me locally on the latest develop:

  • SYNAPSE_VERSION: 1.139.0 (b=develop,1d2ddbc76e,dirty)
  • VERSION: 1.139.0

Only reason we may want to do this is to hide the branch name (some sensitive name that exposes a security fix, etc). But we don't hide anything:

https://matrix.org/_matrix/federation/v1/version

{
  "server": {
    "name": "Synapse",
    "version": "1.139.0rc3 (b=matrix-org-hotfixes-priv,f538ed5ac3)"
  }
}

On matrix.org, the Server response header is masked as cloudflare which would otherwise show 1.139.0rc3 for everything from the main process.


This is spawning from looking at the way we setup and start Synapse for homeserver tenant provisioning in the Synapse Pro for Small Hosts project (https://github.com/element-hq/synapse-small-hosts/issues/221)

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

config.server.server_name,
config=config,
version_string=f"Synapse/{VERSION}",
version_string=f"Synapse/{SYNAPSE_VERSION}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly the same as every other spot where we specify the version_string in the Synapse code base.

@MadLittleMods MadLittleMods marked this pull request as ready for review October 3, 2025 19:07
@MadLittleMods MadLittleMods requested a review from a team as a code owner October 3, 2025 19:07
Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

Seems sensible to me, looks like it just got missed. Thanks for fixing!

@MadLittleMods MadLittleMods merged commit ca27938 into develop Oct 7, 2025
75 of 78 checks passed
@MadLittleMods MadLittleMods deleted the madlittlemods/align-synapse-version-string branch October 7, 2025 15:44
@MadLittleMods
Copy link
Contributor Author

Thanks for the review @anoadragon453 🐢

MadLittleMods added a commit that referenced this pull request Oct 7, 2025
… same (#19012)

Assuming, we're happy with
#19011, this PR makes sense.
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