aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-06-07 16:34:59 +0100
committerGravatar Gareth Coles <[email protected]>2018-06-07 16:34:59 +0100
commitc5d8157670ea2b7f448fc41ca790b25c03a4bedb (patch)
tree428bb0f210b9094d6d147cd2c20144de5c1e8b2e
parent[CI] Add deployment env and cache .gem (diff)
Replace GitHub with GitLab across the project
-rw-r--r--.dockerignore1
-rw-r--r--.gitlab/CONTRIBUTING.md (renamed from .github/CONTRIBUTING.md)8
-rw-r--r--README.md11
-rw-r--r--pysite/migrations/tables/code_jam_participants/v2.py12
-rw-r--r--pysite/tables.py2
-rw-r--r--pysite/views/error_handlers/http_4xx.py3
-rw-r--r--pysite/views/error_handlers/http_5xx.py4
-rw-r--r--pysite/views/main/jams/profile.py6
-rw-r--r--pysite/views/main/redirects/github.py2
-rw-r--r--pysite/views/main/redirects/gitlab.py8
-rw-r--r--pysite/views/wiki/edit.py2
-rw-r--r--templates/main/about/privacy.html10
-rw-r--r--templates/main/base.html2
-rw-r--r--templates/main/info/faq.html2
-rw-r--r--templates/main/info/help.html2
-rw-r--r--templates/main/info/resources.html4
-rw-r--r--templates/main/jams/index.html2
-rw-r--r--templates/main/jams/info.html22
-rw-r--r--templates/main/jams/profile.html10
-rw-r--r--templates/main/jams/retract.html4
-rw-r--r--templates/staff/jams/edit_ending.html2
-rw-r--r--templates/staff/jams/edit_info.html4
-rw-r--r--templates/wiki/base.html2
23 files changed, 77 insertions, 48 deletions
diff --git a/.dockerignore b/.dockerignore
index 210f85f9..b2eb2073 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -6,6 +6,7 @@ __pycache__
.pytest_cache
.git
.github
+.gitlab
.cache
Vagrantfile
.coverage
diff --git a/.github/CONTRIBUTING.md b/.gitlab/CONTRIBUTING.md
index 8b803aca..62b7e739 100644
--- a/.github/CONTRIBUTING.md
+++ b/.gitlab/CONTRIBUTING.md
@@ -7,13 +7,13 @@ contributions may be rejected on the basis of a contributor failing to follow th
## Rules
1. **No force-pushes** or modifying the Git history in any way.
-1. If you have direct access to the repository, **create a branch for your changes** and create a pull request for that branch.
+1. If you have direct access to the repository, **create a branch for your changes** and create a merge request for that branch.
If not, fork it and work on a separate branch there.
* Some repositories require this and will reject any direct pushes to `master`. Make this a habit!
-1. If someone is working on a pull request, **do not open your own pull request for the same task**. Instead, leave some comments
- on the existing pull request. Communication is key, and there's no point in two separate implementations of the same thing.
+1. If someone is working on a merge request, **do not open your own merge request for the same task**. Instead, leave some comments
+ on the existing merge request. Communication is key, and there's no point in two separate implementations of the same thing.
* One option is to fork the other contributor's repository, and submit your changes to their branch with your
- own pull request. If you do this, we suggest following these guidelines when interacting with their repository
+ own merge request. If you do this, we suggest following these guidelines when interacting with their repository
as well.
1. **Adhere to the prevailing code style**, which we enforce using [flake8](http://flake8.pycqa.org/en/latest/index.html).
* Additionally, run `flake8` against your code before you push it. Your commit will be rejected by the build server
diff --git a/README.md b/README.md
index 5a65550f..beec49ed 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
-# Python Discord website
+# Python Discord: Site
-[![Build Status](https://travis-ci.org/discord-python/site.svg?branch=master)](https://travis-ci.org/discord-python/site) [![Coverage Status](https://coveralls.io/repos/github/discord-python/site/badge.svg?branch=master)](https://coveralls.io/github/discord-python/site?branch=master) [![Discord](https://discordapp.com/api/guilds/267624335836053506/embed.png)](https://discord.gg/2B963hn)
+This is all of the code that is responsible for maintaining [our website](https://pythondiscord.com), and all of
+its subdomains.
-### See the wiki for details
-
-[https://github.com/discord-python/site/wiki](https://github.com/discord-python/site/wiki)
+If you're looking to contribute or play around with the code, take a look at our
+[Project Guide](https://wiki.pythondiscord.com/wiki/contributing/project/site), hosted on the wiki you'll find
+in this very repository.
diff --git a/pysite/migrations/tables/code_jam_participants/v2.py b/pysite/migrations/tables/code_jam_participants/v2.py
new file mode 100644
index 00000000..858da279
--- /dev/null
+++ b/pysite/migrations/tables/code_jam_participants/v2.py
@@ -0,0 +1,12 @@
+def run(db, table, table_obj):
+ """
+ GitHub usernames -> Store as GitLab username, this will be correct for most jammers
+ """
+
+ for document in db.get_all(table):
+ if "github_username" in document:
+ document["gitlab_username"] = document["github_username"]
+ del document["github_username"]
+
+ db.insert(table, document, conflict="replace", durability="soft")
+ db.sync(table)
diff --git a/pysite/tables.py b/pysite/tables.py
index 7e43fe87..87e6cf47 100644
--- a/pysite/tables.py
+++ b/pysite/tables.py
@@ -112,7 +112,7 @@ TABLES = {
primary_key="id",
keys=sorted([
"id", # str
- "github_username", # str
+ "gitlab_username", # str
"timezone" # str
])
),
diff --git a/pysite/views/error_handlers/http_4xx.py b/pysite/views/error_handlers/http_4xx.py
index 69c0bdda..1667adcf 100644
--- a/pysite/views/error_handlers/http_4xx.py
+++ b/pysite/views/error_handlers/http_4xx.py
@@ -26,5 +26,6 @@ class Error400View(ErrorView):
return self.render(
"errors/error.html", code=error.code, req=request, error_title=error_desc,
error_message=f"{error_desc} If you believe we have made a mistake, please "
- "<a href='https://github.com/discord-python/site/issues'>open an issue on our GitHub</a>."
+ "<a href='https://gitlab.com/discord-python/projects/site/issues'>"
+ "open an issue on our GitLab</a>."
), error.code
diff --git a/pysite/views/error_handlers/http_5xx.py b/pysite/views/error_handlers/http_5xx.py
index 5a4fbdc2..c9ffa007 100644
--- a/pysite/views/error_handlers/http_5xx.py
+++ b/pysite/views/error_handlers/http_5xx.py
@@ -36,6 +36,6 @@ class Error500View(ErrorView):
"errors/error.html", code=error.code, req=request, error_title=error_desc,
error_message="An error occurred while processing this request, please try "
"again later. If you believe we have made a mistake, please "
- "<a href='https://github.com/discord-python/site/issues'>file an issue on our"
- " GitHub</a>."
+ "<a href='https://gitlab.com/discord-python/projects/site/issues'>file an issue on our"
+ " GitLab</a>."
), error.code
diff --git a/pysite/views/main/jams/profile.py b/pysite/views/main/jams/profile.py
index f84534e6..e918c135 100644
--- a/pysite/views/main/jams/profile.py
+++ b/pysite/views/main/jams/profile.py
@@ -45,13 +45,13 @@ class JamsProfileView(RouteView, DBMixin, OAuthMixin):
if not participant:
participant = {"id": self.user_data["user_id"]}
- github_username = request.form.get("github_username")
+ gitlab_username = request.form.get("gitlab_username")
timezone = request.form.get("timezone")
- if not github_username or not timezone:
+ if not gitlab_username or not timezone:
return BadRequest()
- participant["github_username"] = github_username
+ participant["gitlab_username"] = gitlab_username
participant["timezone"] = timezone
self.db.insert(self.table_name, participant, conflict="replace")
diff --git a/pysite/views/main/redirects/github.py b/pysite/views/main/redirects/github.py
index 3c74ace3..816d165f 100644
--- a/pysite/views/main/redirects/github.py
+++ b/pysite/views/main/redirects/github.py
@@ -4,5 +4,5 @@ from pysite.base_route import RedirectView
class GitHubView(RedirectView):
path = "/github"
name = "github"
- page = "https://github.com/discord-python/"
+ page = "https://gitlab.com/discord-python/"
code = 302
diff --git a/pysite/views/main/redirects/gitlab.py b/pysite/views/main/redirects/gitlab.py
new file mode 100644
index 00000000..eda0e179
--- /dev/null
+++ b/pysite/views/main/redirects/gitlab.py
@@ -0,0 +1,8 @@
+from pysite.base_route import RedirectView
+
+
+class GitLabView(RedirectView):
+ path = "/gitlab"
+ name = "gitlab"
+ page = "https://gitlab.com/discord-python/"
+ code = 302
diff --git a/pysite/views/wiki/edit.py b/pysite/views/wiki/edit.py
index f6f61272..cc121cc6 100644
--- a/pysite/views/wiki/edit.py
+++ b/pysite/views/wiki/edit.py
@@ -156,7 +156,7 @@ class EditView(RouteView, DBMixin):
headers = {
"Authorization": f"token {GITHUB_TOKEN}",
- "User-Agent": "Discord Python Wiki (https://github.com/discord-python)"
+ "User-Agent": "Discord Python Wiki (https://gitlab.com/discord-python)"
}
gist = requests.post("https://api.github.com/gists",
diff --git a/templates/main/about/privacy.html b/templates/main/about/privacy.html
index 3f956247..508536ac 100644
--- a/templates/main/about/privacy.html
+++ b/templates/main/about/privacy.html
@@ -78,9 +78,9 @@
</tr>
<tr>
- <td>GitHub username</td>
+ <td>GitLab username</td>
<td class="uk-table-shrink">Code jam profile</td>
- <td>Used to identify you on GitHub as part of a code jam team</td>
+ <td>Used to identify you on GitLab as part of a code jam team</td>
<td>Public, for code jam team listings</td>
</tr>
<tr class="thick-bottom-border">
@@ -232,6 +232,12 @@
<ul class="uk-list uk-list-divider">
<li>
+ <h4>June 7th, 2018</h4>
+ <p>
+ We no longer collect GitHub usernames - instead, we collect GitLab usernames.
+ </p>
+ </li>
+ <li>
<h4>June 5th, 2018</h4>
<p>
Rectified an omission in the old privacy policy, where the system information you provide
diff --git a/templates/main/base.html b/templates/main/base.html
index 2a3f295c..db7387b4 100644
--- a/templates/main/base.html
+++ b/templates/main/base.html
@@ -47,7 +47,7 @@
<p>
This website uses <a href="https://python.org">Python</a> and
<a href="http://flask.pocoo.org/">Flask</a>, and was developed collaboratively on
- <a href="https://github.com/discord-python/site">GitHub</a>.
+ <a href="https://gitlab.com/discord-python/projects/site">GitLab</a>.
<br />
For privacy &amp; GDPR-related info, please <a href="{{ url_for("main.about.privacy") }}">see this page</a>.
</p>
diff --git a/templates/main/info/faq.html b/templates/main/info/faq.html
index d5fdf059..fb5912f5 100644
--- a/templates/main/info/faq.html
+++ b/templates/main/info/faq.html
@@ -239,7 +239,7 @@
Python is a very versatile language, and a real-life application using it can take
many forms. That said, we do plenty of Python development here ourselves. If
you're curious about this question, then why not take a look at
- <a href="https://github.com/discord-python">our projects</a>?
+ <a href="https://gitlab.com/discord-python">our projects</a>?
</p>
</div>
</div>
diff --git a/templates/main/info/help.html b/templates/main/info/help.html
index 79efcfc3..9cc09af2 100644
--- a/templates/main/info/help.html
+++ b/templates/main/info/help.html
@@ -103,7 +103,7 @@
<p>
If you're still confused, try searching the Internet for people that have already had the same
problem. Often, you won't be the only person to have encountered the issue you're dealing with - more often
- than not, you'll find a GitHub ticket or a StackOverflow question along with a fix or answer to your
+ than not, you'll find a GitLab ticket or a StackOverflow question along with a fix or answer to your
question already posted.
</p>
<p>
diff --git a/templates/main/info/resources.html b/templates/main/info/resources.html
index f3f4d0c0..991ecc8e 100644
--- a/templates/main/info/resources.html
+++ b/templates/main/info/resources.html
@@ -19,9 +19,9 @@
<p>
This page is intended to be a listing of useful resources for beginner and experienced Python
programmers alike. This page is generated from a JSON file
- <a href="https://github.com/discord-python/site/blob/master/static/resources.json">on GitHub</a> -
+ <a href="https://gitlab.com/discord-python/projects/site/blob/master/static/resources.json">on GitLab</a> -
if there's a great resource that you love and you don't see it on this page, feel free to submit a
- pull request!
+ merge request!
</p>
<p>
Some resources aren't free - the below key will help you figure out whether you need to pay for
diff --git a/templates/main/jams/index.html b/templates/main/jams/index.html
index e72e7e84..804a89f3 100644
--- a/templates/main/jams/index.html
+++ b/templates/main/jams/index.html
@@ -67,7 +67,7 @@
</a>
{% else %}
<a class="uk-button uk-button-default" target="_blank" href="{{ jam.repo }}">
- <i class="uk-icon fa-fw fab fa-github"></i> &nbsp;Repository
+ <i class="uk-icon fa-fw fab fa-gitlab"></i> &nbsp;Repository
</a>
{% endif %}
</span>
diff --git a/templates/main/jams/info.html b/templates/main/jams/info.html
index 63f1cea6..920256a6 100644
--- a/templates/main/jams/info.html
+++ b/templates/main/jams/info.html
@@ -17,16 +17,16 @@
Git good - Dropbox bad
</p>
<p>
- All of our code jams happen on <a href="http://github.com/">GitHub</a>. If you don't have an
+ All of our code jams happen on <a href="http://gitlab.com/">GitLab</a>. If you don't have an
account there, you'll need to create one before you can join one of our code jams. Teams are required
to fork the repository we have set up for the current code jam, commit their code to their fork, and
- then open a pull request with their project on the code jam repository.
+ then open a merge request with their project on the code jam repository.
</p>
<p>
Once the challenge task has been announced, head to the link provided to reach the challenge repository.
In order to work on the task, you will need to fork the repository - this will create a copy of the
repository under your account, which you will be able to work on with your teammates. To do so,
- log into GitHub and click on the "Fork" button on the repository page. Select your username from the
+ log into GitLab and click on the "Fork" button on the repository page. Select your username from the
dialogue, and it will be forked to your account.
</p>
<figure>
@@ -55,7 +55,7 @@
<p>
We will use Git to clone the repository to the machine. Simply type <code>git clone &lt;url&gt;</code>
and Git will download a copy of the repository. The URL is the same one you use to get to the
- repository page on GitHub. Use <code>cd project-name</code> to change directory to the repository.
+ repository page on GitLab. Use <code>cd project-name</code> to change directory to the repository.
</p>
<figure>
<img src="{{ static_file('images/jams/jams_6.png') }}" class="uk-align-center uk-border-rounded" />
@@ -73,10 +73,10 @@
terminal, and type <code>git add hello.py</code> to add this file to our changeset.
</p>
<p>
- Next up, we'll need to bundle up our changes into a commit, and push it to GitHub. To do that, we'll
+ Next up, we'll need to bundle up our changes into a commit, and push it to GitLab. To do that, we'll
use <code>git commit -am "message"</code>. Make sure you use a descriptive message explaining why
you made your changes and what they are, but try to keep it to a single line of text if you can.
- Following this, we can use <code>git push origin master</code> to push our commit up to GitHub.
+ Following this, we can use <code>git push origin master</code> to push our commit up to GitLab.
</p>
<figure>
<img src="{{ static_file('images/jams/jams_8.png') }}" class="uk-align-center uk-border-rounded" />
@@ -96,9 +96,9 @@
Oh boy.
</p>
<p>
- Once you've pushed some code to the repository, you will notice a "Pull request" link. Click on
- that to create a pull request, which will let us know that you're working on the task and help us
- to keep track of things. Simply click on the "Create pull request" button on the next page, fill
+ Once you've pushed some code to the repository, you will notice a "Merge request" link. Click on
+ that to create a merge request, which will let us know that you're working on the task and help us
+ to keep track of things. Simply click on the "Create merge request" button on the next page, fill
in the "Title" box with your team number - for example, "Team 1" - and click the big green
button to finish.
</p>
@@ -109,8 +109,8 @@
<img src="{{ static_file('images/jams/jams_16.png') }}" class="uk-align-center uk-border-rounded" />
</figure>
<p>
- Now that your pull request has been created, keep working on your project! Code that you push to
- GitHub will automatically be added to your pull request in real-time. As the code jam continues on,
+ Now that your merge request has been created, keep working on your project! Code that you push to
+ GitLab will automatically be added to your merge request in real-time. As the code jam continues on,
you may find review comments waiting from us. These are just suggestions to help you improve as
a programmer - free advice from us. Feel free to incorporate our suggestions into your project
if you wish.
diff --git a/templates/main/jams/profile.html b/templates/main/jams/profile.html
index ba37f810..660f1540 100644
--- a/templates/main/jams/profile.html
+++ b/templates/main/jams/profile.html
@@ -36,10 +36,10 @@
<div>
<div class="uk-form-label">
- <label class="uk-form-label" for="github_username">GitHub Username</label>
+ <label class="uk-form-label" for="gitlab_username">GitLab Username</label>
</div>
<div class="uk-form-controls-text uk-form-controls">
- <input class="uk-input" type="text" name="github_username" id="github_username" value="{{ participant.github_username }}" required>
+ <input class="uk-input" type="text" name="gitlab_username" id="gitlab_username" value="{{ participant.gitlab_username }}" required>
</div>
</div>
<div>
@@ -81,13 +81,13 @@
<script type="application/javascript">
const tz = moment().format("Z");
- const github_input = document.getElementById("github_username");
+ const gitlab_input = document.getElementById("gitlab_username");
const tz_input = document.getElementById("timezone");
const submit_button = document.getElementById("submit");
function checkInputs() {
- if (github_input.value.length < 1)
+ if (gitlab_input.value.length < 1)
return submit_button.disabled = true;
if (tz_input.value.length < 1)
@@ -96,7 +96,7 @@
submit_button.disabled = false;
}
- github_input.oninput = checkInputs;
+ gitlab_input.oninput = checkInputs;
tz_input.oninput = checkInputs;
if (tz_input.value.length < 1) {
diff --git a/templates/main/jams/retract.html b/templates/main/jams/retract.html
index bbe3bdae..e013337b 100644
--- a/templates/main/jams/retract.html
+++ b/templates/main/jams/retract.html
@@ -16,7 +16,7 @@
{% if banned %}
<p>
- Retracting your code jam profile will remove your date of birth, GitHub username and timezone from our
+ Retracting your code jam profile will remove your date of birth, GitLab username and timezone from our
database. If you're entirely sure that you'd like to remove your profile, please click on the "Remove" button below.
</p>
@@ -27,7 +27,7 @@
</p>
{% else %}
<p>
- Retracting your code jam profile will remove your date of birth, GitHub username and timezone from our
+ Retracting your code jam profile will remove your date of birth, GitLab username and timezone from our
database. If you're entirely sure that you'd like to remove your profile, please click on the "Remove" button below.
</p>
diff --git a/templates/staff/jams/edit_ending.html b/templates/staff/jams/edit_ending.html
index 7bde88ee..82d46978 100644
--- a/templates/staff/jams/edit_ending.html
+++ b/templates/staff/jams/edit_ending.html
@@ -46,7 +46,7 @@
<button class="uk-modal-close-default" type="button" uk-close></button>
<div class="uk-modal-body">
- <h2>Code Jam {{ jam.number }}: {{ jam.title }} <a href="{{ jam.repo }}" id="preview-url"><i class="uk-icon fa-fw fab fa-github"></i></a></h2>
+ <h2>Code Jam {{ jam.number }}: {{ jam.title }} <a href="{{ jam.repo }}" id="preview-url"><i class="uk-icon fa-fw fab fa-gitlab"></i></a></h2>
<p class="uk-text-meta">Theme: <span id="preview-theme">{{ jam.theme }}</span></p>
<div id="preview-div">
diff --git a/templates/staff/jams/edit_info.html b/templates/staff/jams/edit_info.html
index 7fdc3c22..e7abeb54 100644
--- a/templates/staff/jams/edit_info.html
+++ b/templates/staff/jams/edit_info.html
@@ -92,7 +92,7 @@
<button class="uk-modal-close-default" type="button" uk-close></button>
<div class="uk-modal-body">
- <h2>Code Jam {{ jam.number }}: {{ jam.title }} <a href="{{ jam.repo }}" id="preview-info-url"><i class="uk-icon fa-fw fab fa-github"></i></a></h2>
+ <h2>Code Jam {{ jam.number }}: {{ jam.title }} <a href="{{ jam.repo }}" id="preview-info-url"><i class="uk-icon fa-fw fab fa-gitlab"></i></a></h2>
<p class="uk-text-meta">Theme: <span id="preview-info-theme">{{ jam.theme }}</span></p>
<div id="preview-info-div">
@@ -115,7 +115,7 @@
<button class="uk-modal-close-default" type="button" uk-close></button>
<div class="uk-modal-body">
- <h2>Code Jam {{ jam.number }}: {{ jam.title }} <a href="{{ jam.repo }}" id="preview-task-url"><i class="uk-icon fa-fw fab fa-github"></i></a></h2>
+ <h2>Code Jam {{ jam.number }}: {{ jam.title }} <a href="{{ jam.repo }}" id="preview-task-url"><i class="uk-icon fa-fw fab fa-gitlab"></i></a></h2>
<p class="uk-text-meta">Theme: <span id="preview-task-theme">{{ jam.theme }}</span></p>
<div id="preview-task-div">
diff --git a/templates/wiki/base.html b/templates/wiki/base.html
index 2a29d139..e6766aab 100644
--- a/templates/wiki/base.html
+++ b/templates/wiki/base.html
@@ -208,7 +208,7 @@
<p>
This website uses <a href="https://python.org">Python</a> and
<a href="http://flask.pocoo.org/">Flask</a>, and was developed collaboratively on
- <a href="https://github.com/discord-python/site">GitHub</a>.
+ <a href="https://gitlab.com/discord-python/projects/site">GitLab</a>.
<br />
For privacy &amp; GDPR-related info, please <a href="{{ url_for("main.about.privacy") }}">see this page</a>.
</p>