Skip to content

Commit

Permalink
Merge pull request #455 from City-of-Helsinki/dev
Browse files Browse the repository at this point in the history
Dev to main
juho-lehmonen authored Sep 3, 2024

Verified

This commit was signed with the committer’s verified signature.
JounQin JounQin
2 parents 84fc71e + 4b4782f commit 3144c29
Showing 12 changed files with 225 additions and 283 deletions.
113 changes: 25 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Helsinki Päätökset Drupal site

Drupal 9 Website for the Helsinki Päätökset project.
Drupal Website for the Helsinki Päätökset project.

## Environments

@@ -19,6 +19,8 @@ You need to have these applications installed to operate on all environments:

## Create and start the environment

More in-depth instructions for setting up this project and dealing with API content: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/6151897290/Lokaali+kehitysymp+rist

For the first time (new project):

``
@@ -37,27 +39,12 @@ Stop project and remove app container:
$ make down
``


Start project, rebuild and update configuration:

``
$ make up; make build; make post-install
``

Install fresh Drupal site from existing configuration:

``
$ make build; make drush-si; make post-install
``

Start project, update all packages and sync db from production:
Start project, update all packages and sync db from test:

``
$ make fresh
``

**Note:** Will not work at this point, since the production environment has not been set up.

To create a local SQL dump to save your site's state, run:

``
@@ -66,36 +53,6 @@ $ make drush-create-dump

After this, the `make fresh` command should use it instead.

## Update Drupal and composer modules

Update all modules and composer packages:

``
$ make composer-update
``

Update only Drupal core:

``
$ make drupal-update
``

**Note:** After updates, clear caches, run database updates and export possibly changed configuration:

``
$ make drush-cr; make drush-updb; make drush-cex
``

Update Composer.lock if outdated (after merges, etc):

```
# Login into app container first:
$ make shell
# Update lock file:
$ composer update --lock
```

## Configuration management

Export settings:
@@ -125,58 +82,38 @@ $ make lint-drupal
$ make fix-drupal
```

## Development best practices
## Development and coding best practices
Documented in more detail on the project's Confluence page: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/2682126339/Kehitysk+yt+nn+t (in finnish, requires access.)

### Coding standards
Follow Drupal's coding standards: https://www.drupal.org/docs/develop/standards

City of Helsinki's coding standars and best practices: https://dev.hel.fi/

Check for coding style violantions by running `$ make lint-drupal`
## Instance specific features

### Commit messages
Commit message format: "Update development documentation with Git instructions."
Most of the content comes through migration and aggregation scripts. The Päätökset project also has multiple JS applications used for displaying content.

The ticket ID is automatically added to the message based on the branch name.
Critical functionality, API content lifecycle and flow and debugging instructions can be found in Confluence: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/8333819923/Kriittiset+toiminnallisuudet+ja+ongelmatilanteiden+selvitys

The description should be brief and complete the sentence: "If applied, this commit will..".
### Integrations and features
#### AHJO API
The majority of the site's content come from AHJO API: Meetings, motions decisions, policymakers, office holder profiles. Custom modules handle the authentication and aggregation of data.

Additional information can be added in a multiline message, where the first line includes the ticket ID and description.
### Gitflow workflow
The Gitflow workflow is followed, with the following conventions:
Described in more detail here: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/2688254056/AHJO+API

**Main branch**: `dev`. All feature branches are created from `dev` and merged back with pull requests. All new code must be added with pull requests, not committed directly.
#### HelsinkiKanava
Helsinki City Council meeting recordings and livestreams come from HelsinkiKanava. Described in more detail here: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/2689106104/Helsinki-kanavan+videot

**Feature branches**: For example, `PP-123-add-search-functionality`, Always created from and merged back to `dev` with pull requests after code review and testing. Should contain the Jira ticket ID or `PP-0` if a ticket doesn't exist.
#### Datapumppu API
Information for City Council member speaking turns is fetched from here and dislplayed on the council member's profile page. Described in more detail here: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/2689073189/Datapumppu+API

**Release tags**: Code for future releases. For example: `2023-11-08.1`. These tags should be created as Github releases so we can get full release not. Deploying releases happens manually in Azure.
#### Search implementation (ElasticSearch)
Described in more detail here: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/7592214536/Hakutoteutus

### Pull requests
The pull request should contain:
* A link to relevant information (Jira ticket, documentation, etc)
* Description of what it will do if merged
* Steps to get the branch running locally
* Importing / creating test content
* Detailed steps on how to test the pull request
* Specific things to pay attention to when reading the code
#### Internal APIs and AHJO API Proxy
Includes APIs used by Javascript applications (open endpoints) and a proxy for querying AHJO API directly (requires authentication).

Additional steps for frontend related PRs:
* A link to the designs / screenshots of what the functionality should look like (if applicable, mainly for frontend tickets)
Described in more detail here: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/7874904065/Sis+iset+rajapinnat+ja+proxy+Ahjon+suuntaan

Additional steps for bugfix PRs:
* Detailed steps on how to reproduce issue before installing the fix
### Content model and custom components:
Described in more detail here: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/2688516251/Drupal+sis+lt+malli

### Reviewing pull requests
* Assign yourself to the PR before you do anything.
* Check possible issues with code quality checks and automated tests
* Follow the steps for reproducing and testing the issue. If anything is unclear, ask for clarifications in the comments
* The code should have passed basic code quality checks and linters already, so focus on code quality issues that can't be automated. Pay attention to maintainability, readability and extendability
* Ideally, code should be self documenting, but always ask for more documentation and comments in the code if something is unclear. Comments should answer WHY something is done the way it is.
* Always review exported configuration, if included in the change set:
* Does this configuration include everything that it should?
* Does this configuration include something that it should not?
* Exported configuration not relevant to the feature
* Exported local values (enabled devel or kint, etc)
* Sensitive information (passwords, api keys and secrets)
* Are the configuration splits handled correctly?
### Custom roles and permissions:
Described in more detail here: https://helsinkisolutionoffice.atlassian.net/wiki/spaces/PP/pages/6189809682/K+ytt+j+roolit+oikeudet+ja+k+ytt+j+tilit
37 changes: 0 additions & 37 deletions azure-pipelines-master.yml

This file was deleted.

34 changes: 0 additions & 34 deletions azure-pipelines-pull-request.yml

This file was deleted.

30 changes: 0 additions & 30 deletions azure-pipelines-release.yml

This file was deleted.

28 changes: 0 additions & 28 deletions azure-pipelines.yml

This file was deleted.

Loading

0 comments on commit 3144c29

Please sign in to comment.