Commit ec69f533 authored by Claude Paroz's avatar Claude Paroz

Apply changes due to GitLab GNOME migration

parent 0507d31f
Pipeline #13501 passed with stage
in 3 minutes and 51 seconds
......@@ -74,7 +74,7 @@ SCRATCHDIR = ""
POTDIR = os.path.join(SCRATCHDIR, "POT")
# The regex is used to determine if the module is in the standard VCS of the project
VCS_HOME_REGEX = "git\.gnome\.org"
VCS_HOME_REGEX = "gitlab\.gnome\.org"
VCS_HOME_WARNING = gettext_noop("This module is not part of the GNOME Git repository. Please check the module’s web page to see where to send translations.")
# By default, Django stores files locally, using the MEDIA_ROOT and MEDIA_URL settings
......
......@@ -198,9 +198,9 @@
"fields": {
"comment": "",
"archived": false,
"vcs_web": "https://git.gnome.org/browse/gnome-hello/",
"vcs_web": "https://gitlab.gnome.org/GNOME/gnome-hello/",
"name": "gnome-hello",
"vcs_root": "git://git.gnome.org/gnome-hello",
"vcs_root": "https://gitlab.gnome.org/GNOME/gnome-hello.git",
"bugs_product": "test",
"ext_platform": "",
"maintainers": [],
......@@ -217,9 +217,9 @@
"fields": {
"comment": "",
"archived": false,
"vcs_web": "https://git.gnome.org/browse/zenity/",
"vcs_web": "https://gitlab.gnome.org/GNOME/zenity/",
"name": "zenity",
"vcs_root": "git://git.gnome.org/zenity",
"vcs_root": "https://gitlab.gnome.org/GNOME/zenity.git",
"bugs_product": "zenity",
"ext_platform": "",
"maintainers": [],
......
......@@ -74,7 +74,7 @@ class Command(BaseCommand):
else:
# Update all modules
if options['non_gnome']:
modules = Module.objects.exclude(vcs_root__contains='git.gnome.org')
modules = Module.objects.exclude(vcs_root__contains='.gnome.org')
else:
modules = Module.objects.all()
if not self.force_stats:
......
......@@ -1497,7 +1497,7 @@ class Statistics(models.Model):
[{'path':, 'hash':, 'fuzzy':, 'translated':, 'translated_file':}, ...] """
figures = []
if self.full_po and self.domain.dtype == 'doc' and self.full_po.figures:
# something like: "https://git.gnome.org/browse/vinagre / plain / help / %s / %s ?h=master"
# something like: "https://gitlab.gnome.org/GNOME/vinagre / plain / help / %s / %s ?h=master"
url_model = utils.url_join(self.branch.get_vcs_web_url(), self.branch.img_url_prefix,
self.domain.directory, '%s', '%s') + self.branch.img_url_suffix
for fig in self.full_po.figures:
......
......@@ -56,14 +56,14 @@ class FixtureFactory(TestCase):
# Creating models: Modules
gnome_hello = Module.objects.create(name="gnome-hello", vcs_type="git",
vcs_root="git://git.gnome.org/gnome-hello",
vcs_web="https://git.gnome.org/browse/gnome-hello/",
vcs_root="https://gitlab.gnome.org/GNOME/gnome-hello.git",
vcs_web="https://gitlab.gnome.org/GNOME/gnome-hello/",
bugs_base="https://bugzilla.gnome.org",
bugs_product="test", # This product really exists
bugs_component="test")
zenity = Module.objects.create(name="zenity", vcs_type="git",
vcs_root="git://git.gnome.org/zenity",
vcs_web="https://git.gnome.org/browse/zenity/",
vcs_root="https://gitlab.gnome.org/GNOME/zenity.git",
vcs_web="https://gitlab.gnome.org/GNOME/zenity/",
bugs_base="https://bugzilla.gnome.org",
bugs_product="zenity",
bugs_component="general")
......
......@@ -66,7 +66,10 @@ class ModuleTestCase(TestCase):
response = self.client.get(reverse('modules', args=['json']))
content = json.loads(response.content.decode('utf-8'))
self.assertEqual(len(content), Module.objects.count())
self.assertEqual(content[-1]["fields"]["vcs_root"], 'git://git.gnome.org/zenity')
self.assertEqual(
content[-1]["fields"]["vcs_root"],
'https://gitlab.gnome.org/GNOME/zenity.git'
)
def test_module_branch(self):
response = self.client.get(reverse('module_branch', args=['gnome-hello', 'master']))
......@@ -94,8 +97,8 @@ class ModuleTestCase(TestCase):
def test_branch_methods(self):
self.assertTrue(self.branch.is_head())
self.assertEqual(self.branch.get_vcs_url(), "git://git.gnome.org/gnome-hello")
self.assertEqual(self.branch.get_vcs_web_url(), "https://git.gnome.org/browse/gnome-hello/")
self.assertEqual(self.branch.get_vcs_url(), "https://gitlab.gnome.org/GNOME/gnome-hello.git")
self.assertEqual(self.branch.get_vcs_web_url(), "https://gitlab.gnome.org/GNOME/gnome-hello/")
def test_branch_domains(self):
"""
......@@ -321,7 +324,8 @@ class ModuleTestCase(TestCase):
fr_lang = Language.objects.get(locale='fr')
with self.assertRaisesRegex(Exception, 'read-only mode'):
branch.commit_po(po_file, domain, fr_lang, 'Author <someone@example.org>')
self.mod.vcs_root = self.mod.vcs_root.replace('git://', 'ssh://')
# Setup as a writable repo
self.mod.vcs_root = 'git@gitlab.gnome.org:GNOME/%s.git' % self.mod.name
self.mod.save()
update_repo_sequence = (
......@@ -374,6 +378,9 @@ class ModuleTestCase(TestCase):
Committing in non-HEAD branch and checking "sync with master" will
cherry-pick the branch commit on the master branch.
"""
# Setup as a writable repo
self.mod.vcs_root = 'git@gitlab.gnome.org:GNOME/%s.git' % self.mod.name
self.mod.save()
domain = self.mod.domain_set.get(name='po')
commit_dir = self.branch.co_path
run_shell_command(
......@@ -560,7 +567,7 @@ class FigureTests(TestCase):
""" Test if figure urls are properly constructed """
stat = Statistics.objects.get(branch__module__name='gnome-hello', branch__name='master', domain__dtype='doc', language__locale='fr')
figs = stat.get_figures()
self.assertEqual(figs[0]['orig_remote_url'], 'https://git.gnome.org/browse/gnome-hello/plain/help/C/figures/gnome-hello-new.png?h=master')
self.assertEqual(figs[0]['orig_remote_url'], 'https://gitlab.gnome.org/GNOME/gnome-hello/plain/help/C/figures/gnome-hello-new.png?h=master')
self.assertFalse('trans_remote_url' in figs[0])
@test_scratchdir
......
......@@ -30,9 +30,9 @@
<dt>{% trans "Project wiki" %}</dt>
<dd><a href="https://wiki.gnome.org/DamnedLies">https://wiki.gnome.org/DamnedLies</a></dd>
<dt>{% trans "Bug tracking page" %}</dt>
<dd><a href="https://bugzilla.gnome.org/browse.cgi?product=damned-lies">https://bugzilla.gnome.org/browse.cgi?product=damned-lies</a></dd>
<dd><a href="https://gitlab.gnome.org/GNOME/damned-lies/issues/">https://gitlab.gnome.org/GNOME/damned-lies/issues/</a></dd>
<dt>{% trans "Source code" %}</dt>
<dd><a href="https://git.gnome.org/browse/damned-lies/">https://git.gnome.org/browse/damned-lies</a></dd>
<dd><a href="https://gitlab.gnome.org/GNOME/damned-lies/">https://git.gnome.org/browse/damned-lies</a></dd>
<dt>{% trans "Workflow" %}</dt>
<dd><a href="https://l10n.gnome.org/help/vertimus_workflow/">https://l10n.gnome.org/help/vertimus_workflow</a></dd>
</dl>
......
......@@ -113,7 +113,7 @@
<li><a href="https://mail.gnome.org/mailman/listinfo">{% trans "Mailing Lists" %}</a></li>
<li><a href="https://wiki.gnome.org/GnomeIrcChannels">{% trans "IRC Channels" %}</a></li>
<li><a href="https://bugzilla.gnome.org/">{% trans "Bug Tracker" %}</a></li>
<li><a href="https://git.gnome.org/browse/">{% trans "Development Code" %}</a></li>
<li><a href="https://gitlab.gnome.org/GNOME/">{% trans "Development Code" %}</a></li>
</ul>
</li>
<li><a href="https://www.gnome.org/news/">{% trans "News" %}</a>
......
......@@ -37,8 +37,8 @@ class VertimusTest(TeamsAndRolesTests):
name='gedit', description='GNOME Editor',
bugs_base="https://bugzilla.gnome.org/",
bugs_product='gedit', bugs_component='general',
vcs_type='git', vcs_root="git://git.gnome.org/gedit",
vcs_web="http://git.gnome.org/browse/gedit/"
vcs_type='git', vcs_root="https://gitlab.gnome.org/GNOME/gedit.git",
vcs_web="https://gitlab.gnome.org/GNOME/gedit/"
)
Branch.checkout_on_creation = False
......@@ -199,7 +199,8 @@ class VertimusTest(TeamsAndRolesTests):
action_names = [a.name for a in state.get_available_actions(self.pc)]
self.assertEqual(action_names, ['IC', 'TR', 'UNDO', 'WC'])
self.b.module.vcs_root = self.b.module.vcs_root.replace('git://', 'ssh://')
# Setup as a writable repo
self.b.module.vcs_root = 'git@gitlab.gnome.org:GNOME/%s.git' % self.b.module.name
self.b.module.save()
action_names = [a.name for a in state.get_available_actions(self.pcoo)]
self.assertEqual(action_names, ['CI', 'WC', 'UNDO', None, 'IC', 'AA'])
......@@ -375,7 +376,8 @@ class VertimusTest(TeamsAndRolesTests):
self.assertIsInstance(state, StateCommitting)
def test_action_ci(self):
self.b.module.vcs_root = self.b.module.vcs_root.replace('git://', 'ssh://')
# Setup as a writable repo
self.b.module.vcs_root = 'git@gitlab.gnome.org:GNOME/%s.git' % self.b.module.name
self.b.module.save()
state = StateProofreading(branch=self.b, domain=self.d, language=self.l, person=self.pr)
state.save()
......@@ -419,7 +421,7 @@ class VertimusTest(TeamsAndRolesTests):
pers = Person.objects.create(email='user@example.org', username='username_only')
Role.objects.create(team=self.t, person=pers, role='reviewer')
m = Module.objects.create(
name='gnome-hello', vcs_type='git', vcs_root="ssh://git.gnome.org/gnome-hello",
name='gnome-hello', vcs_type='git', vcs_root="git@gitlab.gnome.org:GNOME/gnome-hello.git",
)
Branch.checkout_on_creation = False
b = Branch(name='master', module=m, file_hashes={})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment