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

Explicitly set github repo in instance presenter spec #24036

Merged
merged 2 commits into from Mar 9, 2023

Conversation

mjankowski
Copy link
Contributor

Alternate approach to #24027

@@ -89,8 +89,28 @@
end

describe '#source_url' do
it 'returns "https://github.com/mastodon/mastodon"' do
expect(instance_presenter.source_url).to eq('https://github.com/mastodon/mastodon')
context 'with an env variable set' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
context 'with an env variable set' do
context 'with GITHUB_REPOSITORY env variable set' do

end
end

context 'without an env variable set' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
context 'without an env variable set' do
context 'without GITHUB_REPOSITORY env variable set' do

@@ -117,6 +117,7 @@ end

group :test do
gem 'capybara', '~> 3.38'
gem 'climate_control'
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth adding a little description, even though this hasn't been done elsewhere yet

Suggested change
gem 'climate_control'
# Used to mock ENV values in specs
gem 'climate_control'

@ClearlyClaire ClearlyClaire merged commit 2f7a663 into mastodon:main Mar 9, 2023
27 checks passed
@mjankowski mjankowski deleted the fork-env-var-repo-thing branch March 9, 2023 13:29
@bocan
Copy link
Contributor

bocan commented Mar 9, 2023

I wish "GITHUB_REPOSITORY" had been GIT_REPOSITORY instead, and held the full URL instead of appending to "https://github.com/". #24027 is one problem, but it would have been nice to point the "View Source Code" link to my Gitlab instance where I build this thing rather than Github where I only use the fork tools.

@nschonni
Copy link
Contributor

nschonni commented Mar 9, 2023

Yeah, I'm not sure what the best practice is these days around prefixing the environment variables either. Maybe these should be MASTODON_* ones, but you could always submit a new patch to improve the logic, and see if it's accepted

@mjankowski
Copy link
Contributor Author

it would have been nice to point the "View Source Code" link to my Gitlab instance..

I didn't actually that closely at this when I was fixing the "github actions breaks on forks" thing ... but it looks like you can set SOURCE_BASE_URL env var and it will override the full value.

Separately -- now that I actually look at this, a good spec refactor here would be to move basically all of this stuff out of the instance presenter spec and into a spec for Mastodon::Version since thats where the bulk of this logic happens (the presenter just calls a method on the version class).

rhelmer added a commit to MozillaSocial/mastodon that referenced this pull request Mar 20, 2023
* Skip double building on Dependabot branches (mastodon#24025)

* Bump pg from 1.4.5 to 1.4.6 (mastodon#24001)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump yargs from 17.7.0 to 17.7.1 (mastodon#24002)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sidekiq-scheduler from 5.0.1 to 5.0.2 (mastodon#24004)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rack from 2.2.6.2 to 2.2.6.3 (mastodon#23997)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump axios from 1.3.3 to 1.3.4 (mastodon#23996)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump utf-8-validate from 6.0.2 to 6.0.3 (mastodon#23992)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump omniauth_openid_connect from 0.6.0 to 0.6.1 (mastodon#23991)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump doorkeeper from 5.6.4 to 5.6.5 (mastodon#24009)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jest from 29.4.3 to 29.5.0 (mastodon#24003)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jest-environment-jsdom from 29.4.3 to 29.5.0 (mastodon#23998)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rubocop from 1.45.1 to 1.48.0 (mastodon#23999)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mkdirp from 2.1.3 to 2.1.5 (mastodon#23994)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump babel-jest from 29.4.3 to 29.5.0 (mastodon#24007)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add refreshing many accounts at once with "tootctl accounts refresh" (mastodon#23304)

* Skip rebase-needed job for i10n branch (mastodon#24026)

* Unescape HTML entities (mastodon#24019)

* Explicitly set github repo in instance presenter spec (mastodon#24036)

* Center the text itself in upload area (mastodon#24029)

* Sync CI and Docker Compose image versions (mastodon#24053)

* Bump puma from 6.1.0 to 6.1.1 (mastodon#24045)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Serializers spec coverage (mastodon#24017)

* Coverage improvement round-out following up previous work (mastodon#23987)

* Bump pghero from 3.1.0 to 3.2.0 (mastodon#24044)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump eslint from 8.33.0 to 8.35.0 (mastodon#24049)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Enable RSpec/FilePath (mastodon#23965)

* Add basic search specs for chewy indexes (mastodon#24065)

* Fix sidekiq jobs not triggering Elasticsearch index updates (mastodon#24046)

* Enable Rubocop Performance/DeleteSuffix (mastodon#24077)

* Prefer the stored location as after_sign_in_path in Omniauth Callback Controller (mastodon#24073)

* Bump jsdom from 21.1.0 to 21.1.1 (mastodon#24090)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pghero from 3.2.0 to 3.3.0 (mastodon#24085)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Support the PROXY protocol through the PROXY_PROTO_V1 env variable (mastodon#24064)

* Bump rack from 2.2.6.3 to 2.2.6.4 (mastodon#24097)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rails from 6.1.7.2 to 6.1.7.3 (mastodon#24096)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rubocop from 1.48.0 to 1.48.1 (mastodon#24095)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Push Docker images to Github Container Registry as well (mastodon#24101)

* Skip Docker CI Login/Push on forks (mastodon#23564)

* Change sidekiq-bulk's batch size from 10,000 to 1,000 jobs in one Redis call (mastodon#24034)

* Redirect users to SLO at the IdP after logging them out of Mastodon. (mastodon#24020)

* Add spec for the CLI `version` task (mastodon#23978)

* Update PostCSS dependencies (mastodon#23835)

* Fix dashboard crash on ElasticSearch server error (mastodon#23751)

* Fix incorrect post links in strikes when the account is remote (mastodon#23611)

* Fix misleading error code when receiving invalid WebAuthn credentials (mastodon#23568)

* Setup haml-lint CI with todo config (mastodon#23524)

* Use Github Container Registry as the official container image source (mastodon#24113)

* Skip pushing containers on forks (mastodon#24106)

* Fix more haml-lint Rubocop (mastodon#24107)

* Autofix Rubocop Style/PreferredHashMethods (mastodon#23851)

* Bump rack-test from 2.0.2 to 2.1.0 (mastodon#24112)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Autofix Rubocop Style/RedundantArgument (mastodon#23798)

* Bump immutable from 4.2.4 to 4.3.0 (mastodon#24088)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @babel/eslint-parser from 7.19.1 to 7.21.3 (mastodon#24109)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump eslint from 8.35.0 to 8.36.0 (mastodon#24089)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove `bullet` and `active_record_query_trace` gems (mastodon#24121)

* Add `SENDFILE_HEADER` environment variable (mastodon#24123)

* Bump @babel/core from 7.21.0 to 7.21.3 (mastodon#24111)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add cache headers to static files served through Rails (mastodon#24120)

* Bump autoprefixer from 10.4.13 to 10.4.14 (mastodon#24108)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sass from 1.58.3 to 1.59.3 (mastodon#24105)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Regen rubocop-todo without Max shadowing (mastodon#24076)

* Refactor monkey-patching of `PrivateAddressCheck` (mastodon#24122)

* Replace `Status#translatable?` with language matrix in separate endpoint (mastodon#24037)

* New Crowdin updates (mastodon#23904)

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

* Roll back unintentionally activated rubocop rules (mastodon#24132)

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: Nick Schonning <nschonni@gmail.com>

* Change user backups to use expiring URLs for download when possible (mastodon#24136)

* Add warning for object storage misconfiguration (mastodon#24137)

* Ignore additional Style/OptionalBooleanParameter (mastodon#24138)

* Bump glob from 8.1.0 to 9.3.0 (mastodon#24110)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rimraf from 4.1.2 to 4.4.0 (mastodon#24048)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Link to the Identity provider's account settings from the account settings (mastodon#24100)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Include config/ and update all rubcop deps (mastodon#23963)

* Workaround the ActiveRecord / Marshal serialization bug on Ruby 3.2 (mastodon#24142)

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>

* Dedupe yarn.lock with yarn-deduplicate (mastodon#24119)

* Revert "Dedupe yarn.lock with yarn-deduplicate" (mastodon#24155)

* Upgrade redis-node to latest (mastodon#24154)

* Webhooks for local status.create, status.update, account.update (mastodon#24133)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Nick Schonning <nschonni@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 9p4 <vcs@ersei.net>
Co-authored-by: Christian Schmidt <github@chsc.dk>
Co-authored-by: Matt Jankowski <matt@jankowski.online>
Co-authored-by: Rodion Borisov <vintprox@gmail.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: CSDUMMI <31551856+CSDUMMI@users.noreply.github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com>
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Co-authored-by: Vyr Cossont <VyrCossont@users.noreply.github.com>
rutvijmehta-harness pushed a commit to rutvijmehta-harness/mastodon that referenced this pull request Mar 20, 2023
rutvijmehta-harness added a commit to rutvijmehta-harness/mastodon that referenced this pull request Mar 20, 2023
#44)

Co-authored-by: Matt Jankowski <matt@jankowski.online>
arachnist pushed a commit to arachnist/mastodon that referenced this pull request Apr 4, 2023
skerit pushed a commit to 11ways/mastodon that referenced this pull request Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants