Skip to content

Commit

Permalink
Drop SVN support (mozilla#3527)
Browse files Browse the repository at this point in the history
Also:
* Drop heroku-buildpack-apt (incl. Aptfile)
  • Loading branch information
eemeli authored Jan 15, 2025
1 parent 23dc10b commit 402bf74
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 152 deletions.
2 changes: 0 additions & 2 deletions Aptfile

This file was deleted.

7 changes: 0 additions & 7 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@
"required": false,
"value": ""
},
"SVN_LD_LIBRARY_PATH": {
"description": "Path to prepend to ``LD_LIBRARY_PATH`` when running SVN. This is necessary on Heroku because the Python buildpack alters the path in a way that breaks the built-in SVN command.",
"value": "/usr/lib/x86_64-linux-gnu/"
},
"TZ": {
"description": "Timezone for the dynos that will run the app. Pontoon operates in UTC",
"value": "UTC"
Expand All @@ -134,9 +130,6 @@
{
"url": "https://github.com/Osmose/heroku-buildpack-ssh"
},
{
"url": "https://github.com/mozilla/heroku-buildpack-apt.git#v0.1"
},
{
"url": "heroku/nodejs"
},
Expand Down
18 changes: 3 additions & 15 deletions docs/admin/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ Buildpack
---------
Pontoon uses several buildpacks in a specific order. They are (in order):

1. `heroku-buildpack-apt`_ for installing Subversion.
2. `heroku-buildpack-ssh`_ for setting up the SSH keys necessary for committing
to version control.
3. The official ``heroku/nodejs`` buildpack for installing Node.js programs for
pre-processing frontend assets.
4. The official ``heroku/python`` buildpack as our primary buildpack.
1. `heroku-buildpack-ssh`_ for setting up the SSH keys necessary for committing to version control.
2. The official ``heroku/nodejs`` buildpack for installing Node.js programs for pre-processing frontend assets.
3. The official ``heroku/python`` buildpack as our primary buildpack.

You can set these buildpacks on your app with the following toolbelt commands:

Expand All @@ -37,7 +34,6 @@ You can set these buildpacks on your app with the following toolbelt commands:
heroku buildpacks:add --index 1 https://github.com/Osmose/heroku-buildpack-ssh.git#v0.1
heroku buildpacks:add --index 1 https://github.com/mozilla/heroku-buildpack-apt.git#v0.1
.. _heroku-buildpack-apt: https://github.com/mozilla/heroku-buildpack-apt
.. _heroku-buildpack-ssh: https://github.com/Osmose/heroku-buildpack-ssh

Environment Variables
Expand Down Expand Up @@ -289,9 +285,6 @@ you create:
Host hg.mozilla.org
User [email protected]

Host svn.mozilla.org
User [email protected]

``SSH_KEY``
SSH private key to use for authentication when Pontoon connects to VCS
servers via SSH.
Expand Down Expand Up @@ -322,11 +315,6 @@ you create:
`send_suggestion_notifications` management command will run. 0 represents
Monday, 6 represents Sunday. The default value is 4 (Friday).

``SVN_LD_LIBRARY_PATH``
Path to prepend to ``LD_LIBRARY_PATH`` when running SVN. This is necessary
on Heroku because the Python buildpack alters the path in a way that breaks
the built-in SVN command. Set this to ``/usr/lib/x86_64-linux-gnu/``.

``SYNC_TASK_TIMEOUT``
Optional. Multiple sync tasks for the same project cannot run concurrently to
prevent potential DB and VCS inconsistencies. We store the information about
Expand Down
7 changes: 3 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ It can handle any project that uses one of the supported file formats:
- .xliff
- .xml (Android)

Pontoon can pull strings it needs to translate from an external source, and write
them back periodically. Typically these external sources are version control
repositories that store the strings for an application. Supported external
sources include **Git**, **Mercurial** and **Subversion**.
Pontoon pulls strings it needs to translate from an external source and writes them back periodically.
Typically these external sources are version control repositories that store the strings for an application.
Supported external sources are **Git** and **Mercurial** repositories.

Other Documentation
-------------------
Expand Down
19 changes: 19 additions & 0 deletions pontoon/base/migrations/0071_alter_repository_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.17 on 2025-01-15 08:19

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("base", "0070_userprofile_transactional_emails"),
]

operations = [
migrations.AlterField(
model_name="repository",
name="type",
field=models.CharField(
choices=[("git", "Git"), ("hg", "HG")], default="git", max_length=255
),
),
]
3 changes: 1 addition & 2 deletions pontoon/base/models/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def repository_url_validator(url):
# Regular URLs
validator = URLValidator(["http", "https", "ftp", "ftps", "ssh", "svn+ssh"])
validator = URLValidator(["http", "https", "ftp", "ftps", "ssh"])

# Git SCP-like URL
pattern = r"git@[\w\.@]+[/:][\w-]+/[\w-]+(.git)?/?"
Expand All @@ -37,7 +37,6 @@ class Repository(models.Model):
class Type(models.TextChoices):
GIT = "git", "Git"
HG = "hg", "HG"
SVN = "svn", "SVN"

project = models.ForeignKey("Project", models.CASCADE, related_name="repositories")
type = models.CharField(max_length=255, default=Type.GIT, choices=Type.choices)
Expand Down
3 changes: 0 additions & 3 deletions pontoon/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ def path(*args):

SITE_URL = os.environ.get("SITE_URL", "http://localhost:8000")

# Custom LD_LIBRARY_PATH environment variable for SVN
SVN_LD_LIBRARY_PATH = os.environ.get("SVN_LD_LIBRARY_PATH", "")

# URL to the RabbitMQ server
BROKER_URL = os.environ.get("RABBITMQ_URL", None)

Expand Down
4 changes: 1 addition & 3 deletions pontoon/sync/repositories/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import git, hg, svn
from . import git, hg
from .utils import CommitToRepositoryException, PullFromRepositoryException


Expand All @@ -15,7 +15,5 @@ def get_repo(type: str):
return git
elif type == "hg":
return hg
elif type == "svn":
return svn
else:
raise NotImplementedError
96 changes: 0 additions & 96 deletions pontoon/sync/repositories/svn.py

This file was deleted.

20 changes: 0 additions & 20 deletions pontoon/sync/tests/test_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ def test_hg_revision(self, mock_popen, mock_log):
assert get_repo("hg").revision("path/") is None
mock_log.error.assert_called_with(CONTAINS("stderr", "identify", "path/"))

@patch("pontoon.sync.repositories.svn.log")
@patch("subprocess.Popen")
def test_svn_revision(self, mock_popen, mock_log):
attrs = {"communicate.return_value": (b"output", b"stderr"), "returncode": 1}
mock_popen.return_value = Mock(**attrs)
assert get_repo("svn").revision("path/") is None
mock_log.error.assert_called_with(CONTAINS("stderr", "svnversion", "path/"))


class VCSChangedFilesTests:
"""
Expand Down Expand Up @@ -84,15 +76,3 @@ class HgChangedFilesTest(VCSChangedFilesTests, TestCase):
R removed_file2.properties
"""
).encode()


class SVNChangedFilesTest(VCSChangedFilesTests, TestCase):
repo_type = "svn"
shell_output = dedent(
"""
M changed_file1.properties
M changed_file2.properties
D removed_file1.properties
D removed_file2.properties
"""
).encode()

0 comments on commit 402bf74

Please sign in to comment.