Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Make parse_server_name more consistent #14007

Merged

Conversation

Abdullah0sama
Copy link
Contributor

@Abdullah0sama Abdullah0sama commented Oct 1, 2022

Fixes #12122

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.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

Signed-off-by: Abdullah Osama abdullahosama15@gmail.com

@Abdullah0sama Abdullah0sama requested a review from a team as a code owner October 1, 2022 20:28
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

Thanks! In the test_validate_bad_server_names unit test can you add a check for ":80" please?

changelog.d/14007.misc Outdated Show resolved Hide resolved
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

Thanks!

@erikjohnston erikjohnston enabled auto-merge (squash) October 10, 2022 10:31
@anoadragon453
Copy link
Member

I've merged latest develop into this PR's branch in order to make CI pass. Unit tests were failing with the following backtrace:

error log
Error: 
Traceback (most recent call last):
  File "/tmp/tmp.A21RKCLSkU/tests/unittest.py", line 119, in new
    return code(orig, *args, **kwargs)
  File "/tmp/tmp.A21RKCLSkU/tests/unittest.py", line 163, in setUp
    return orig()
  File "/tmp/tmp.A21RKCLSkU/tests/unittest.py", line 271, in setUp
    self.hs = self.make_homeserver(self.reactor, self.clock)
  File "/tmp/tmp.A21RKCLSkU/tests/rest/media/v1/test_url_preview.py", line 95, in make_homeserver
    hs = self.setup_test_homeserver(config=config)
  File "/tmp/tmp.A21RKCLSkU/tests/unittest.py", line 516, in setup_test_homeserver
    config_obj.parse_config_dict(config, "", "")
  File "/synapse/build/debian/matrix-synapse-py3/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/config/_base.py", line 794, in parse_config_dict
    self.invoke_all(
  File "/synapse/build/debian/matrix-synapse-py3/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/config/_base.py", line 393, in invoke_all
    res[config_class.section] = getattr(config, func_name)(*args, **kwargs)
  File "/synapse/build/debian/matrix-synapse-py3/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/config/repository.py", line 208, in read_config
    check_requirements("url_preview")
  File "/synapse/build/debian/matrix-synapse-py3/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/util/check_dependencies.py", line 181, in check_requirements
    raise ValueError(f"Synapse {VERSION} does not provide the feature '{extra}'")
builtins.ValueError: Synapse 1.69.0rc1 does not provide the feature 'url_preview'

@DMRobertson
Copy link
Contributor

I've merged latest develop into this PR's branch in order to make CI pass. Unit tests were failing with the following backtrace:
error log

Xref #14079

@erikjohnston erikjohnston merged commit a9934d4 into matrix-org:develop Oct 11, 2022
@richvdh richvdh changed the title Making parse_server_name more consistent Make parse_server_name more consistent Oct 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parse_and_validate_server_name(":80") raises IndexError instead of ValueError
4 participants