Skip to content

Commit

Permalink
Merge pull request #3510 from alphagov/new-apps-repos-pages
Browse files Browse the repository at this point in the history
New 'Repos' page and consolidation of 'Apps' page
  • Loading branch information
ChrisBAshton authored May 11, 2022
2 parents 49d86d0 + 233abd9 commit e20e7c3
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 89 deletions.
16 changes: 0 additions & 16 deletions app/repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,4 @@ def self.active
def self.active_apps
Repos.active.select(&:is_app?)
end

def self.grouped_by_team
Repos.active.reject(&:private_repo?).group_by(&:team)
end

def self.teams
Repos.grouped_by_team.keys.reject { |team| team == UNKNOWN }
end

def self.for_team(team)
Repos.grouped_by_team.fetch(team, []).map(&:repo_name)
end

def self.no_known_owner
Repos.for_team(UNKNOWN)
end
end
4 changes: 0 additions & 4 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ def manual
Manual.new(sitemap)
end

def teams
Repos.teams
end

def related_things
@related_things ||= RelatedThings.new(manual, current_page)
end
Expand Down
2 changes: 2 additions & 0 deletions config/tech-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ show_review_banner: false
header_links:
Get started: /manual/get-started.html
Apps: /apps.html
Repos: /repos.html
Manual: /manual.html
Schemas: /content-schemas.html
Document types: /document-types.html
Expand Down Expand Up @@ -74,6 +75,7 @@ redirects:
/apps/bouncer.html: /repos/bouncer.html
/apps/business-support-api.html: /repos/business-support-api.html
/apps/business-support-finder.html: /repos/business-support-finder.html
/apps/by-team.html: /apps.html
/apps/cache-clearing-service.html: /repos/cache-clearing-service.html
/apps/calculators.html: /repos/calculators.html
/apps/calendars.html: /repos/calendars.html
Expand Down
56 changes: 27 additions & 29 deletions source/apps.html.md.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
---
layout: repo_layout
title: Applications on GOV.UK
---

The publishing platform of GOV.UK consists of at least <%= Repos.active_apps.size %>
separate applications. Most of them are built using [Ruby on Rails][rails].
# Applications on GOV.UK

## Hosting
GOV.UK consists of at least <%= Repos.active_apps.size %> separate applications.
Most of them are built using [Ruby on Rails][rails], hosted on an infrastructure [configured using puppet][govuk-puppet] and deployed using [capistrano scripts][govuk-app-deployment].

Apps can be loosely grouped into different types, including:

- **APIs** provide functionality to other apps. For example, an app can publish content via Publishing API.
- **Frontend apps** render content to GOV.UK users. For example, a [HMRC manual page][hmrc-manual] is rendered by an application called [manuals-frontend][manuals-frontend]. Use the [chrome extension][extension] to find out which application is rendering any given page, and [read more about the frontend architecture on GOV.UK](/manual/frontend-architecture.html).
- **Publishing apps** are used by editors to publish content to GOV.UK. For example, [specialist-publisher][specialist-publisher] publishes [specialist documents][specialist documents]. The apps are secured by behind a [single signon system][signon].

## Apps by type

| Type | Count | Applications |
| --- | --- | --- |
<% Repos.active_apps.group_by(&:type).sort.each do |name, apps| %>
| # <%= name %> | <%= apps.count %> | <%= apps.map { |app| "[#{app.repo_name}](/repos/#{app.repo_name}.html)" }.join(", ") %> |
<% end %>

## Apps by team

| Type | Count | Applications |
| --- | --- | --- |
<% Repos.active_apps.group_by(&:team).sort.each do |name, apps| %>
| # <%= name %> | <%= apps.count %> | <%= apps.map { |app| "[#{app.repo_name}](/repos/#{app.repo_name}.html)" }.join(", ") %> |
<% end %>

## Apps by host

| Hosting | Count | Applications |
| --- | --- | --- |
Expand All @@ -26,31 +49,6 @@ In Google Spreadsheets, use the following formula to import all of the data:
=importData("https://docs.publishing.service.gov.uk/apps.csv")
```

## Infrastructure

Applications are hosted on an infrastructure [configured using puppet][govuk-puppet].
They are deployed using [capistrano scripts][govuk-app-deployment].

## Frontend apps

Frontend apps render content to visitors to [www.gov.uk](https://www.gov.uk/).
For example, a [HMRC manual page][hmrc-manual] is rendered by an application called
[manuals-frontend][manuals-frontend].

You can use the [chrome extension][extension] to find out which application
is rendering any given page.

You can [read more about the frontend architecture on GOV.UK](/manual/frontend-architecture.html).

## Publishing apps

Publishing apps are used by editors to publish content to GOV.UK. For example,
[specialist-publisher][specialist-publisher] publishes
[specialist documents][specialist documents].

The apps are secured by behind a [single signon system][signon]. They use an
[omniauth adapter called gds-sso][gds-sso] to authenticate the user.

[rails]: http://rubyonrails.org/
[extension]: https://github.com/alphagov/govuk-browser-extension
[govuk-puppet]: https://github.com/alphagov/govuk-puppet
Expand Down
25 changes: 0 additions & 25 deletions source/apps/by-team.html.md.erb

This file was deleted.

33 changes: 33 additions & 0 deletions source/repos.html.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: All GOV.UK repositories
---

# All GOV.UK repositories

GOV.UK maintains at least <%= Repos.active.size %> repositories including apps, services, gems and documentation.

## Repos by type

| Type | Count | Repos |
| --- | --- | --- |
<% Repos.active.group_by(&:type).sort.each do |name, repos| %>
| # <%= name %> | <%= repos.count %> | <%= repos.map { |repo| "[#{repo.repo_name}](/repos/#{repo.repo_name}.html)" }.join(", ") %> |
<% end %>

## Repos by team

| Type | Count | Repos |
| --- | --- | --- |
<% Repos.active.group_by(&:team).sort.each do |name, repos| %>
| # <%= name %> | <%= repos.count %> | <%= repos.map { |repo| "[#{repo.repo_name}](/repos/#{repo.repo_name}.html)" }.join(", ") %> |
<% end %>

## Reuse this data

You can download this data as JSON or as CSV ([repos.json](/repos.json) and [repos.csv](/repos.csv)).

In Google Spreadsheets, use the following formula to import all of the data:

```
=importData("https://docs.publishing.service.gov.uk/repos.csv")
```
15 changes: 0 additions & 15 deletions spec/app/repos_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,4 @@
expect(Repos.active_apps.map(&:repo_name)).to eq(%w[asset-manager])
end
end

describe "for_team" do
let(:repos) do
[
{ repo_name: "retired", team: "#foo", retired: true },
{ repo_name: "private", team: "#foo", private_repo: true },
{ repo_name: "hosted-app", team: "#foo", retired: false, production_hosted_on: "aws" },
{ repo_name: "unhosted-tool", team: "#foo", retired: false },
]
end

it "should return all public, non-retired repos owned by a particular team" do
expect(Repos.for_team("#foo")).to eq(%w[hosted-app unhosted-tool])
end
end
end

0 comments on commit e20e7c3

Please sign in to comment.