Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use owner name as site title for User and Organization sites. #197

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

lardieri
Copy link
Contributor

@lardieri lardieri commented Feb 23, 2021

Resolve #196

Using the repo name as the site title makes sense for Projects, which can choose their own repo names. But User and Organization sites must use repo names like {owner}.github.io which:

  • Does not look good as a browser tab title, bookmark, or header for a page that is supposed to be about a person or organization.
  • Conveys no useful information, as it is unlikely that anyone would clone or fork such a repo.
  • Looks confusing for users or organizations that use custom domains (CNAMEs), and have no other content indicating their site is hosted by GitHub.

The display name of the user or organization is a better choice. This is an optional property, so fall back to (login) name if display name is not present.

@lardieri lardieri changed the title Resolve jekyll/github-metadata#196 - Use owner name as site title for User and Organization sites. Use owner name as site title for User and Organization sites. Feb 23, 2021
@lardieri
Copy link
Contributor Author

I'd like to add a couple of new tests in site_github_munger_spec.rb around line 110 or so, but it looks like I might need to add a new test-site as well. Probably best to consult with a project owner before proceeding.

@mattr-
Copy link
Member

mattr- commented Feb 23, 2021

Add your tests and a new test site. Whatever you think is necessary to properly test this.

Copy link
Member

@mattr- mattr- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a nice addition as is, but i support your desire to add tests. Please add whatever tests and related fixtures (test site, etc.) that you think are necessary. However, if you find after a few days that adding the tests is a lot of extra work, let's go ahead and skip them and ship this without.

lib/jekyll-github-metadata/site_github_munger.rb Outdated Show resolved Hide resolved
@MichaelCurrin
Copy link
Contributor

CI checks are failing still.

.gitignore Outdated Show resolved Hide resolved
@MichaelCurrin
Copy link
Contributor

MichaelCurrin commented Mar 1, 2021

Thanks for renaming.

Please see additional suggestion on removing the code comment.

@MichaelCurrin
Copy link
Contributor

Tests

I see two 2 failing AppVeyor tests from checks.

Tthe one looks like SSL error outside of this PR scope.

The other issue looks possibly relevant. Test job from build #37997173

      1) Jekyll::GitHubMetadata::Owner is an ORG fetches login
         Failure/Error: expect(subject.public_send(attribute)).to eq(expected_value)
           expected: "jekyll"
                got: nil
           (compared using ==)
         # ./spec/owner_spec.rb:43:in `block (4 levels) in <top (required)>'
    Finished in 1 minute 31.39 seconds (files took 1.23 seconds to load)

But also, tests are failing in general across PRs so this may have been an issue already.

https://ci.appveyor.com/project/jekyll/github-metadata/history

Copy link
Contributor

@MichaelCurrin MichaelCurrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

@lardieri
Copy link
Contributor Author

lardieri commented Mar 1, 2021

Tests

The other issue looks possibly relevant. Test job from build #37997173

My new code does not distinguish between User and Organization owners. If my code caused this failure, then the test case Jekyll::GitHubMetadata::Owner is a USER would have failed as well.

But also, tests are failing in general across PRs so this may have been an issue already.

https://ci.appveyor.com/project/jekyll/github-metadata/history

The failures are not consistent across obviously irrelevant commits, such as my change to .gitignore.

Nor are the failures reproducible locally using the same seed and the same Ruby / Jekyll versions in the environment.

It's reasonable to conclude that some issue with the AppVeyor environment is responsible for the failures. Possible hypotheses:

  • AppVeyor is not pulling the environment that it says that it is.
    -- Perhaps a corrupt local cache of some kind.
    -- Perhaps some bug or other difference in the Windows implementation of Ruby vs. Unix.
  • Hardware issue with AppVeyor worker machines (random 1-bit errors, etc.).
  • Some type of Chaos Monkey has been introduced.

There are also obvious issues with order dependency in these tests. For example:

  • --seed 41261 produces warnings for test cases when git doesn't exist and with name set, but no title
  • --seed 58031 runs the same tests in a different order and produces no warnings

(I would argue that the warnings are correct, given the context of those specific cases.)

So, I'm not losing sleep over these test failures. If you disagree, please suggest a concrete course of investigation.

@MichaelCurrin
Copy link
Contributor

MichaelCurrin commented Mar 1, 2021

Thanks for investigating. Yes I suspected the tests were in an inconsistent state already, so further changes to tests aren't needed I think

Using the repo name as the site title makes sense for Projects, which can choose their own repo names. But User and Organization sites must use repo names like "{owner}.github.io" which:

* Does not look good as a browser tab title, bookmark, or header for a page that is supposed to be about a person or organization.
* Conveys no useful information, as it is unlikely that anyone would clone or fork such a repo.
* Looks confusing for users or organizations that use custom domains (CNAMEs), and have no other content indicating their site is hosted by GitHub.

The display name of the user or organization is a better choice. This is an optional property, so fall back to (login) name if display name is not present.

Resolve jekyll#196
@lardieri
Copy link
Contributor Author

Might also resolve #207 ?

When generating metadata for a GitHub Pages site of a User or Organization, the default site title should be:
* the User/Org's display name, if there is one; or
* the User/Org's login, if there is no display name.
@lardieri
Copy link
Contributor Author

@mattr- I just pushed the test cases that I promised you back in February. Would you mind taking a look, and merging if you approve? Thank you.

@lardieri lardieri requested a review from mattr- July 12, 2021 21:24
@lardieri
Copy link
Contributor Author

lardieri commented Aug 2, 2021

@mattr- and @MichaelCurrin - any further thoughts on this? or are you ready to merge it in? Thanks.

@MichaelCurrin
Copy link
Contributor

@lardieri The code and tests look clear and thorough. Approved.

@mattr-
Copy link
Member

mattr- commented Aug 3, 2021

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit 0efda2e into jekyll:master Aug 3, 2021
jekyllbot added a commit that referenced this pull request Aug 3, 2021
@parkr parkr mentioned this pull request Jan 27, 2022
@jekyll jekyll locked and limited conversation to collaborators Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use owner name as site title for User and Organization sites.
4 participants