Repository navigation
Fix create_remotes on GitHub and make the API tests configurable - #148
Merged
Merged
Conversation
create_remotes read ssh_url_to_repo from the created repositories, which only GitLab projects have, so on GitHub it created both repositories and then failed with an AttributeError. Each remote now returns the SSH URL of its response type. GitLabRemote.delete_remote ended its name and namespace checks in pass, so it deleted every project matching the search; it now only deletes the exact project. The server_api tests used fixed accounts of a single developer and a fixed repository name. They now read the namespaces from environment variables, are skipped when these are not set, use random repository names and always clean up. Offline tests for both fixes run in CI.
hannahlanzrath
added this pull request to stack #149
October 5, 2026 14:49
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
Cleanup deleted the test names even if creating them had failed, so an existing repository with the same name would have been removed. A fixture now records repositories after they were created and deletes only those, and warns about repositories it could not delete.
BaseRepo requires CADET-RDM metadata, which a newly created remote does not have.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixes
create_remoteson GitHub: it readssh_url_to_repofrom the created repositories, an attribute only GitLab projects have. On GitHub it created both repositories and then failed with anAttributeError, sorepo.create_remotes(...)/rdm remote createnever worked there. Each remote class now hasssh_url(response), which returns the SSH URL for its host.GitLabRemote.delete_remote: its name and namespace checks ended inpassinstead ofcontinue, so it deleted every project the search returned. It now only deletes the exact projectnamespace/name.Configurable API tests (
tests/test_gitlab_api.py→tests/test_remote_api.py)server_apitests were hardcoded to one developer's accounts and used a fixed repository name. They now read their accounts from environment variables:CADET_RDM_TEST_GITLAB_NAMESPACE,CADET_RDM_TEST_GITHUB_NAMESPACECADET_RDM_TEST_GITLAB_URL,CADET_RDM_TEST_GITLAB_USERNAME,CADET_RDM_TEST_GITHUB_USERNAMEfinallyblock, so runs by different developers can't interfere.CONTRIBUTING.mddescribes the variables, tokens and SSH requirements, and the release checklist template points there.Offline tests (
tests/test_remote_integration.py, run in CI)create_remotesadds the right SSH URLs for faked GitHub and GitLab responses.delete_remotedeletes only the exact match.The CI test selection passes locally (76 passed).
Run against GitHub: with
CADET_RDM_TEST_GITHUB_NAMESPACE=hannahlanzrath, both GitHub tests pass. That includescreate_remotes, which confirms the fix against the real API, and no test repositories were left behind. The GitLab tests were skipped because no GitLab token was available.Cleanup safety: the tests only delete repositories they created themselves (recorded after a successful
create_remote), and they warn about any repository they couldn't delete.