Skip to content

Commit 25489eb

Browse files
authored
Fix "Github" spelling (#11102)
It's called "GitHub", not "Github"… 😅
1 parent 921c732 commit 25489eb

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

crates/crates_io_database/src/models/team.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ use diesel_async::{AsyncPgConnection, RunQueryDsl};
55
use crate::models::{Crate, CrateOwner, Owner, OwnerKind};
66
use crate::schema::{crate_owners, teams};
77

8-
/// For now, just a Github Team. Can be upgraded to other teams
8+
/// For now, just a GitHub Team. Can be upgraded to other teams
99
/// later if desirable.
1010
#[derive(Queryable, Identifiable, serde::Serialize, serde::Deserialize, Debug, Selectable)]
1111
pub struct Team {
1212
/// Unique table id
1313
pub id: i32,
1414
/// "github:org:team"
15-
/// An opaque unique ID, that was at one point parsed out to query Github.
15+
/// An opaque unique ID, that was at one point parsed out to query GitHub.
1616
/// We only query membership with github using the github_id, though.
1717
/// This is the only name we should ever talk to Cargo about.
1818
pub login: String,

crates/crates_io_github/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type Result<T> = std::result::Result<T, GitHubError>;
1919
#[cfg_attr(feature = "mock", mockall::automock)]
2020
#[async_trait]
2121
pub trait GitHubClient: Send + Sync {
22-
async fn current_user(&self, auth: &AccessToken) -> Result<GithubUser>;
22+
async fn current_user(&self, auth: &AccessToken) -> Result<GitHubUser>;
2323
async fn org_by_name(&self, org_name: &str, auth: &AccessToken) -> Result<GitHubOrganization>;
2424
async fn team_by_name(
2525
&self,
@@ -53,7 +53,7 @@ impl RealGitHubClient {
5353
Self { client }
5454
}
5555

56-
/// Does all the nonsense for sending a GET to Github.
56+
/// Does all the nonsense for sending a GET to GitHub.
5757
async fn _request<T, A>(&self, url: &str, apply_auth: A) -> Result<T>
5858
where
5959
T: DeserializeOwned,
@@ -98,7 +98,7 @@ impl RealGitHubClient {
9898

9999
#[async_trait]
100100
impl GitHubClient for RealGitHubClient {
101-
async fn current_user(&self, auth: &AccessToken) -> Result<GithubUser> {
101+
async fn current_user(&self, auth: &AccessToken) -> Result<GitHubUser> {
102102
self.request("/user", auth).await
103103
}
104104

@@ -183,7 +183,7 @@ impl From<reqwest::Error> for GitHubError {
183183
}
184184

185185
#[derive(Debug, Deserialize)]
186-
pub struct GithubUser {
186+
pub struct GitHubUser {
187187
pub avatar_url: Option<String>,
188188
pub email: Option<String>,
189189
pub id: i32,

docs/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ docker compose up -d
548548
The Compose file is filled out with a sane set of defaults that should Just
549549
Work™ out of the box without any modification. Individual settings can be
550550
overridden by creating a `docker-compose.override.yml` with the updated config.
551-
For example, in order to specify a set of Github OAuth Client credentials, a
551+
For example, in order to specify a set of GitHub OAuth Client credentials, a
552552
`docker-compose.override.yml` file might look like this:
553553

554554
```yaml

src/controllers/krate/owners.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ async fn add_team_owner(
390390
Ok(NewOwnerInvite::Team(team))
391391
}
392392

393-
/// Tries to create or update a Github Team. Assumes `org` and `team` are
393+
/// Tries to create or update a GitHub Team. Assumes `org` and `team` are
394394
/// correctly parsed out of the full `name`. `name` is passed as a
395395
/// convenience to avoid rebuilding it.
396396
pub async fn create_or_update_github_team(

src/controllers/session.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::schema::users;
1515
use crate::util::diesel::is_read_only_error;
1616
use crate::util::errors::{AppResult, bad_request, server_error};
1717
use crate::views::EncodableMe;
18-
use crates_io_github::GithubUser;
18+
use crates_io_github::GitHubUser;
1919
use crates_io_session::SessionExtension;
2020

2121
#[derive(Debug, Serialize, utoipa::ToSchema)]
@@ -124,7 +124,7 @@ pub async fn authorize_session(
124124
}
125125

126126
pub async fn save_user_to_database(
127-
user: &GithubUser,
127+
user: &GitHubUser,
128128
access_token: &str,
129129
emails: &Emails,
130130
conn: &mut AsyncPgConnection,
@@ -220,7 +220,7 @@ mod tests {
220220
let test_db = TestDatabase::new();
221221
let mut conn = test_db.async_connect().await;
222222

223-
let gh_user = GithubUser {
223+
let gh_user = GitHubUser {
224224
email: Some("String.Format(\"{0}.{1}@live.com\", FirstName, LastName)".into()),
225225
name: Some("My Name".into()),
226226
login: "github_user".into(),

src/tests/user.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::tests::util::github::next_gh_id;
55
use crate::tests::util::{MockCookieUser, RequestHelper};
66
use crate::util::token::HashedToken;
77
use chrono::{DateTime, Utc};
8-
use crates_io_github::GithubUser;
8+
use crates_io_github::GitHubUser;
99
use diesel::prelude::*;
1010
use diesel_async::RunQueryDsl;
1111
use http::StatusCode;
@@ -30,7 +30,7 @@ async fn updating_existing_user_doesnt_change_api_token() -> anyhow::Result<()>
3030
let token = token.plaintext();
3131

3232
// Reuse gh_id but use new gh_login and gh_access_token
33-
let gh_user = GithubUser {
33+
let gh_user = GitHubUser {
3434
id: gh_id,
3535
login: "bar".to_string(),
3636
name: None,
@@ -67,10 +67,10 @@ async fn github_without_email_does_not_overwrite_email() -> anyhow::Result<()> {
6767

6868
// Simulate logging in via GitHub with an account that has no email.
6969

70-
// Because faking GitHub is terrible, call what GithubUser::save_to_database does directly.
70+
// Because faking GitHub is terrible, call what GitHubUser::save_to_database does directly.
7171
// Don't use app.db_new_user because it adds a verified email.
7272
let gh_id = next_gh_id();
73-
let gh_user = GithubUser {
73+
let gh_user = GitHubUser {
7474
id: gh_id,
7575
login: "arbitrary_username".to_string(),
7676
name: None,
@@ -94,7 +94,7 @@ async fn github_without_email_does_not_overwrite_email() -> anyhow::Result<()> {
9494

9595
// Simulate the same user logging in via GitHub again, still with no email in GitHub.
9696

97-
let gh_user = GithubUser {
97+
let gh_user = GitHubUser {
9898
id: gh_id,
9999
login: "arbitrary_username".to_string(),
100100
name: None,
@@ -135,7 +135,7 @@ async fn github_with_email_does_not_overwrite_email() -> anyhow::Result<()> {
135135

136136
let emails = app.as_inner().emails.clone();
137137

138-
let gh_user = GithubUser {
138+
let gh_user = GitHubUser {
139139
// Use the same github ID to link to the existing account
140140
id: model.gh_id,
141141
login: "arbitrary_username".to_string(),
@@ -193,7 +193,7 @@ async fn test_confirm_user_email() -> anyhow::Result<()> {
193193

194194
let emails = &app.as_inner().emails;
195195

196-
let gh_user = GithubUser {
196+
let gh_user = GitHubUser {
197197
id: next_gh_id(),
198198
login: "arbitrary_username".to_string(),
199199
name: None,
@@ -239,7 +239,7 @@ async fn test_existing_user_email() -> anyhow::Result<()> {
239239

240240
let emails = &app.as_inner().emails;
241241

242-
let gh_user = GithubUser {
242+
let gh_user = GitHubUser {
243243
id: next_gh_id(),
244244
login: "arbitrary_username".to_string(),
245245
name: None,

src/tests/util/github.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::anyhow;
22
use crates_io_github::{
33
GitHubError, GitHubOrgMembership, GitHubOrganization, GitHubTeam, GitHubTeamMembership,
4-
GithubUser, MockGitHubClient,
4+
GitHubUser, MockGitHubClient,
55
};
66
use std::sync::atomic::{AtomicUsize, Ordering};
77

@@ -75,9 +75,9 @@ impl MockData {
7575
mock
7676
}
7777

78-
fn current_user(&self) -> Result<GithubUser, GitHubError> {
78+
fn current_user(&self) -> Result<GitHubUser, GitHubError> {
7979
let user = &self.users[0];
80-
Ok(GithubUser {
80+
Ok(GitHubUser {
8181
id: user.id,
8282
login: user.login.into(),
8383
name: Some(user.name.into()),

0 commit comments

Comments
 (0)