Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
2e71a66d
Commit
2e71a66d
authored
Nov 23, 2015
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GitHub has a capital H
parent
6a92d4cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
lms/templates/sysadmin_dashboard.html
+2
-2
scripts/release.py
+9
-9
No files found.
lms/templates/sysadmin_dashboard.html
View file @
2e71a66d
...
@@ -145,8 +145,8 @@ textarea {
...
@@ -145,8 +145,8 @@ textarea {
</li>
</li>
</ul>
</ul>
<div
class=
"form-actions"
>
<div
class=
"form-actions"
>
## Translators: Git
h
ub is a popular website for hosting code
## Translators: Git
H
ub is a popular website for hosting code
<button
type=
"submit"
name=
"action"
value=
"add_course"
>
${_('Load new course from
gith
ub')}
</button>
<button
type=
"submit"
name=
"action"
value=
"add_course"
>
${_('Load new course from
GitH
ub')}
</button>
</div>
</div>
<hr
/>
<hr
/>
<ul
class=
"list-input"
>
<ul
class=
"list-input"
>
...
...
scripts/release.py
View file @
2e71a66d
...
@@ -130,7 +130,7 @@ def ensure_pr_fetch():
...
@@ -130,7 +130,7 @@ def ensure_pr_fetch():
def
get_github_creds
():
def
get_github_creds
():
"""
"""
Returns Git
h
ub credentials if they exist, as a two-tuple of (username, token).
Returns Git
H
ub credentials if they exist, as a two-tuple of (username, token).
Otherwise, return None.
Otherwise, return None.
"""
"""
netrc_auth
=
requests
.
utils
.
get_netrc_auth
(
"https://api.github.com"
)
netrc_auth
=
requests
.
utils
.
get_netrc_auth
(
"https://api.github.com"
)
...
@@ -157,8 +157,8 @@ def create_github_creds():
...
@@ -157,8 +157,8 @@ def create_github_creds():
"note"
:
"edx-release"
,
"note"
:
"edx-release"
,
"scopes"
:
[
"repo"
],
"scopes"
:
[
"repo"
],
}
}
username
=
raw_input
(
"Git
h
ub username: "
)
username
=
raw_input
(
"Git
H
ub username: "
)
password
=
getpass
.
getpass
(
"Git
h
ub password: "
)
password
=
getpass
.
getpass
(
"Git
H
ub password: "
)
response
=
requests
.
post
(
response
=
requests
.
post
(
"https://api.github.com/authorizations"
,
"https://api.github.com/authorizations"
,
auth
=
(
username
,
password
),
auth
=
(
username
,
password
),
...
@@ -179,7 +179,7 @@ def create_github_creds():
...
@@ -179,7 +179,7 @@ def create_github_creds():
if
message
!=
"Validation Failed"
:
if
message
!=
"Validation Failed"
:
raise
requests
.
exceptions
.
RequestException
(
message
)
raise
requests
.
exceptions
.
RequestException
(
message
)
else
:
else
:
# A token called "edx-release" already exists on Git
h
ub.
# A token called "edx-release" already exists on Git
H
ub.
# Delete it, and try again.
# Delete it, and try again.
token_id
=
get_github_auth_id
(
username
,
password
,
"edx-release"
)
token_id
=
get_github_auth_id
(
username
,
password
,
"edx-release"
)
if
token_id
:
if
token_id
:
...
@@ -198,7 +198,7 @@ def create_github_creds():
...
@@ -198,7 +198,7 @@ def create_github_creds():
def
get_github_auth_id
(
username
,
password
,
note
):
def
get_github_auth_id
(
username
,
password
,
note
):
"""
"""
Return the ID associated with the Git
h
ub auth token with the given note.
Return the ID associated with the Git
H
ub auth token with the given note.
If no such auth token exists, return None.
If no such auth token exists, return None.
"""
"""
response
=
requests
.
get
(
response
=
requests
.
get
(
...
@@ -229,7 +229,7 @@ def delete_github_auth_token(username, password, token_id):
...
@@ -229,7 +229,7 @@ def delete_github_auth_token(username, password, token_id):
def
ensure_github_creds
(
attempts
=
3
):
def
ensure_github_creds
(
attempts
=
3
):
"""
"""
Make sure that we have Git
h
ub OAuth credentials. This will check the user's
Make sure that we have Git
H
ub OAuth credentials. This will check the user's
.netrc file, as well as the ~/.config/edx-release file. If no credentials
.netrc file, as well as the ~/.config/edx-release file. If no credentials
exist in either place, it will prompt the user to create OAuth credentials,
exist in either place, it will prompt the user to create OAuth credentials,
and store them in ~/.config/edx-release.
and store them in ~/.config/edx-release.
...
@@ -240,7 +240,7 @@ def ensure_github_creds(attempts=3):
...
@@ -240,7 +240,7 @@ def ensure_github_creds(attempts=3):
return
False
return
False
# Looks like we need to create the OAuth creds
# Looks like we need to create the OAuth creds
print
(
"We need to set up OAuth authentication with Git
h
ub's API. "
print
(
"We need to set up OAuth authentication with Git
H
ub's API. "
"Your password will not be stored."
,
file
=
sys
.
stderr
)
"Your password will not be stored."
,
file
=
sys
.
stderr
)
token
=
None
token
=
None
for
_
in
range
(
attempts
):
for
_
in
range
(
attempts
):
...
@@ -255,7 +255,7 @@ def ensure_github_creds(attempts=3):
...
@@ -255,7 +255,7 @@ def ensure_github_creds(attempts=3):
else
:
else
:
break
break
if
token
:
if
token
:
print
(
"Successfully authenticated to Git
h
ub"
,
file
=
sys
.
stderr
)
print
(
"Successfully authenticated to Git
H
ub"
,
file
=
sys
.
stderr
)
if
not
token
:
if
not
token
:
print
(
"Too many invalid authentication attempts."
,
file
=
sys
.
stderr
)
print
(
"Too many invalid authentication attempts."
,
file
=
sys
.
stderr
)
return
False
return
False
...
@@ -333,7 +333,7 @@ def get_merge_commit(commit, branch="master"):
...
@@ -333,7 +333,7 @@ def get_merge_commit(commit, branch="master"):
def
get_pr_info
(
num
):
def
get_pr_info
(
num
):
"""
"""
Returns the info from the Git
h
ub API
Returns the info from the Git
H
ub API
"""
"""
url
=
"https://api.github.com/repos/edx/edx-platform/pulls/{num}"
.
format
(
num
=
num
)
url
=
"https://api.github.com/repos/edx/edx-platform/pulls/{num}"
.
format
(
num
=
num
)
username
,
token
=
get_github_creds
()
username
,
token
=
get_github_creds
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment