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

feat!: Bump 0.27 #366

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9e7f378
bump decidim and ruby versions
eliegaboriau May 17, 2023
3d16eae
remove reminder feature
eliegaboriau May 17, 2023
04195a6
add new migrations and comment friendly signup
eliegaboriau May 17, 2023
e6fea40
update packages and webpack
eliegaboriau May 17, 2023
743a97f
update ludens branch and remove collaborative draft fix
eliegaboriau May 17, 2023
c6e6c8e
remove fix survey conditional no longer needed
eliegaboriau May 17, 2023
69f8273
update editor images spec
eliegaboriau Jul 10, 2023
b84e999
update managed user event spec
eliegaboriau Jul 10, 2023
6476fa7
update i18n specs and files
eliegaboriau Jul 10, 2023
216d4b0
comment friendly signup related and fix questionnaire spec
eliegaboriau Jul 11, 2023
e31bcc0
update multiple specs
eliegaboriau Jul 11, 2023
585011d
fix proposals spec
eliegaboriau Jul 11, 2023
28f32f5
fix failing tests and reenable friendly signup
eliegaboriau Jul 13, 2023
d716263
add linux platform
eliegaboriau Jul 13, 2023
7048874
lint
eliegaboriau Jul 13, 2023
f3de659
fix tests
eliegaboriau Jul 13, 2023
53b08a3
lint
eliegaboriau Jul 13, 2023
6cdbecc
change ludens branch
eliegaboriau Jul 13, 2023
e95a99b
change ludens branch
eliegaboriau Jul 13, 2023
7ce554a
change docker ruby version
eliegaboriau Jul 13, 2023
ad5a249
fix specs
eliegaboriau Jul 17, 2023
a451eaa
lint
eliegaboriau Jul 17, 2023
3ddfc0d
change friendly signup branch
eliegaboriau Jul 17, 2023
b44e614
add deface
eliegaboriau Jul 17, 2023
5efb92d
Merge branch 'develop' into bump_0.27
Quentinchampenois Aug 23, 2023
26a81f4
fix: change to libpq in Dockerfile
Quentinchampenois Aug 23, 2023
4dfe0a7
fix: Deactivate gallery
Quentinchampenois Aug 23, 2023
d111822
fix: Upgrade Decidim
Quentinchampenois Aug 23, 2023
f6055e9
fix: Rubocop offenses
Quentinchampenois Aug 23, 2023
3160f01
fix: Add postgresql-dev to Dockerfile
Quentinchampenois Aug 23, 2023
c2dfb5a
Add c++11 capabilities
armandfardeau Aug 24, 2023
4a82d1e
Add debug
armandfardeau Aug 24, 2023
f583fa5
Merge branch 'develop' into bump_0.27
armandfardeau Aug 25, 2023
3336bb9
fix: Use debian slim in Dockerfile for v0.27 (#419)
armandfardeau Aug 28, 2023
53bcd77
Merge branch 'develop' into bump_0.27
armandfardeau Aug 28, 2023
eb4b189
fix: Fix case when content active model attribute (#422)
armandfardeau Aug 28, 2023
878e8d0
feat: Add initiatives gem to 0.27 branch (#418)
paulinebessoles Aug 28, 2023
e77c5a3
Merge branch 'develop' into bump_0.27
armandfardeau Aug 28, 2023
87e4309
Fix offenses
armandfardeau Aug 28, 2023
fce1ce9
Fix tests
armandfardeau Aug 28, 2023
015b6bd
Fix bundler version
armandfardeau Aug 28, 2023
68c2414
Fix flaky
armandfardeau Aug 28, 2023
14eccb5
feat: Add extended socio demo ah (#420)
paulinebessoles Aug 28, 2023
4bd1cc2
Use decidim 0.27.4 (#423)
armandfardeau Aug 29, 2023
6be0191
feat: Send digest notifications (#424)
armandfardeau Aug 31, 2023
5eb0895
Rename step
armandfardeau Aug 31, 2023
af78c96
Fix term customizer to patched branch (#427)
armandfardeau Aug 31, 2023
299fb12
fix: Bump ruby-version to 3.0.6 in Docker and CI
Quentinchampenois Sep 4, 2023
b85984e
feat: Add module extra user fields (#426)
paulinebessoles Sep 4, 2023
959c1be
feat: Add docker-compose dev mode
Quentinchampenois Sep 4, 2023
d74eee4
refactor: Remove CD for develop rc and staging
Quentinchampenois Sep 4, 2023
cf53b38
feat: Add commands to Makefile
Quentinchampenois Sep 4, 2023
4119c62
fix: Allow rc/ branchs to push images to registry
Quentinchampenois Sep 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 13 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ BACKUP_S3SYNC_ACCESS_KEY=
BACKUP_S3SYNC_SECRET_KEY=
BACKUP_S3SYNC_BUCKET=
BACKUP_S3RETENTION_ENABLED=
INITIATIVES_CREATION_ENABLED=
INITIATIVES_SIMILARITY_THRESHOLD=
INITIATIVES_SIMILARITY_LIMIT=
INITIATIVES_MINIMUM_COMMITTEE_MEMBERS=
INITIATIVES_DEFAULT_SIGNATURE_TIME_PERIOD_LENGTH=
INITIATIVES_DEFAULT_COMPONENTS=
INITIATIVES_FIRST_NOTIFICATION_PERCENTAGE=
INITIATIVES_SECOND_NOTIFICATION_PERCENTAGE=
INITIATIVES_STATS_CACHE_EXPIRATION_TIME=
INITIATIVES_MAX_TIME_IN_VALIDATING_STATE=
INITIATIVES_PRINT_ENABLED=
INITIATIVES_DO_NOT_REQUIRE_AUTHORIZATION=
SPAM_DETECTION_API_AUTH_TOKEN=
SPAM_DETECTION_API_URL=
SPAM_DETECTION_NAME=
Expand Down Expand Up @@ -47,4 +59,4 @@ TRANSLATOR_ENABLED=0
TRANSLATOR_API_KEY=
TRANSLATOR_HOST=
TRANSLATOR_DELAY=0
GALLERY_ANIMATION_ENABLE=0
GALLERY_ANIMATION_ENABLE=0
50 changes: 5 additions & 45 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
CI: "true"
SIMPLECOV: "true"
RSPEC_FORMAT: "documentation"
RUBY_VERSION: 2.7.5
RUBY_VERSION: 3.0.6
RAILS_ENV: test
NODE_VERSION: 16.9.1
RUBYOPT: '-W:no-deprecated'
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- name: Create db
- name: Check for Zeitwerk errors
run: |
bundle exec rails zeitwerk:check
tests:
Expand Down Expand Up @@ -216,50 +216,10 @@ jobs:
database_host: ${{ env.DATABASE_HOST }}
# We don't want to upload the image to the registry if the build fails, but we don't care when on a PR for speed reasons
push: ${{ github.ref != 'refs/heads/develop' || github.ref != 'refs/heads/master' }}
deploy_develop:
if: "github.ref == 'refs/heads/develop'"
needs: [lint, tests, system_tests, test_build]
name: Deploy develop branch on develop instance
runs-on: ubuntu-latest
steps:
- name: Run Ansible playbook
uses: appleboy/[email protected]
with:
host: ${{ secrets.ANSIBLE_HOST }}
username: ${{ secrets.ANSIBLE_USERNAME }}
key: ${{ secrets.ANSIBLE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: ansible-playbook -u ${{ secrets.ANSIBLE_USERNAME }} --private-key="~/.ssh/ansible-deploy/ansible-deploy" -i /home/${{ secrets.ANSIBLE_USERNAME }}/ansible/decidim/inventories/develop.yml /home/${{ secrets.ANSIBLE_USERNAME }}/ansible/decidim/playbooks/update_decidim_app.yml
deploy_rc:
if: "github.ref == 'refs/heads/rc'"
needs: [lint, tests, system_tests, test_build]
name: Deploy rc branch on RC instance
runs-on: ubuntu-latest
steps:
- name: Run Ansible playbook
uses: appleboy/[email protected]
with:
host: ${{ secrets.ANSIBLE_HOST }}
username: ${{ secrets.ANSIBLE_USERNAME }}
key: ${{ secrets.ANSIBLE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: ansible-playbook -u ${{ secrets.ANSIBLE_USERNAME }} --private-key="~/.ssh/ansible-deploy/ansible-deploy" -i /home/${{ secrets.ANSIBLE_USERNAME }}/ansible/decidim/inventories/rc.yml /home/${{ secrets.ANSIBLE_USERNAME }}/ansible/decidim/playbooks/update_decidim_app.yml
deploy_staging:
if: "github.ref == 'refs/heads/master'"
needs: [lint, tests, system_tests, test_build]
name: Deploy staging branch on staging instance
runs-on: ubuntu-latest
steps:
- name: Run Ansible playbook
uses: appleboy/[email protected]
with:
host: ${{ secrets.ANSIBLE_HOST }}
username: ${{ secrets.ANSIBLE_USERNAME }}
key: ${{ secrets.ANSIBLE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: ansible-playbook -u ${{ secrets.ANSIBLE_USERNAME }} --private-key="~/.ssh/ansible-deploy/ansible-deploy" -i /home/${{ secrets.ANSIBLE_USERNAME }}/ansible/decidim/inventories/staging.yml /home/${{ secrets.ANSIBLE_USERNAME }}/ansible/decidim/playbooks/update_decidim_app.yml
build_and_push_image_dev:
if: "github.ref == 'refs/heads/develop'"
if: "contains('
refs/heads/develop
refs/heads/rc/', github.ref)"
name: Build and push image to Registry
needs: [ lint, tests, system_tests, test_build ]
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ workflow_dispatch ]
env:
CI: "true"
SIMPLECOV: "true"
RUBY_VERSION: 2.7.5
RUBY_VERSION: 3.0.6
RAILS_ENV: test
NODE_VERSION: 16.9.1
RUBYOPT: '-W:no-deprecated'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ yarn-debug.log*
.yarn-integrity
.idea
coverage/
public/sw.js*
3 changes: 3 additions & 0 deletions .rubocop_rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ Rails/Validation:
Include:
- app/models/**/*.rb

Rails/CompactBlank:
Enabled: false

Rails/BulkChangeTable:
Exclude:
- db/**/*
Expand Down
16 changes: 8 additions & 8 deletions .rubocop_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ AllCops:
- "vendor/**/*"
- "node_modules/**/*"
- "db/schema.rb"
- "db/migrate/*.rb"
- "bin/*"
# Default formatter will be used if no -f/--format option is given.
DefaultFormatter: progress
Expand Down Expand Up @@ -67,12 +68,7 @@ AllCops:
# If a value is specified for TargetRubyVersion then it is used.
# Else if .ruby-version exists and it contains an MRI version it is used.
# Otherwise we fallback to the oldest officially supported Ruby version (2.0).
TargetRubyVersion: 2.7

RSpec:
Patterns:
- "(?:^|/)spec/"
- "(?:^|/)test/"
TargetRubyVersion: 3.0

Lint/SafeNavigationChain:
Exclude:
Expand Down Expand Up @@ -287,6 +283,9 @@ Style/HashEachMethods:
Style/HashLikeCase:
MinBranchesCount: 5

Style/OpenStructUse:
Enabled: false

# Indentation of `when`.
Layout/CaseIndentation:
EnforcedStyle: case
Expand Down Expand Up @@ -1272,10 +1271,11 @@ RSpec/NamedSubject:
Enabled: false

RSpec/RepeatedExampleGroupDescription:
Enabled: false
Enabled: true

RSpec/RepeatedExampleGroupBody:
Enabled: false
Enabled: true

RSpec/VerifiedDoubles:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
3.0.6
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
FROM rg.fr-par.scw.cloud/decidim-app-base/decidim-app-base:2.7.5-alpine-jemalloc as builder
FROM ruby:3.0.6-slim as builder

ENV RAILS_ENV=production \
SECRET_KEY_BASE=dummy

WORKDIR /app

# TODO: Use repository version of jemalloc when available
RUN apk add --no-cache --update nodejs yarn tzdata git icu-dev libpq-dev build-base proj proj-dev postgresql-client imagemagick && \
RUN apt-get update && \
apt-get -y install libpq-dev curl git libicu-dev build-essential && \
curl https://deb.nodesource.com/setup_16.x | bash && \
apt-get install -y nodejs && \
npm install --global yarn && \
gem install bundler:2.4.9

COPY Gemfile* ./
RUN bundle config set --local without 'development test' && bundle install
RUN bundle config set --local without 'development test' && \
bundle install -j"$(nproc)"

COPY package* ./
COPY yarn.lock .
Expand All @@ -30,22 +34,22 @@ RUN rm -rf node_modules tmp/cache vendor/bundle spec \
&& find /usr/local/bundle/gems/ -type d -name "spec" -prune -exec rm -rf {} \; \
&& rm -rf log/*.log

FROM ruby:2.7.5-alpine as runner
FROM ruby:3.0.6-slim as runner

ENV RAILS_ENV=production \
SECRET_KEY_BASE=dummy \
RAILS_LOG_TO_STDOUT=true

RUN apk add --no-cache --update icu-dev tzdata postgresql-client proj proj-dev imagemagick && \
RUN apt update && \
apt install -y postgresql-client imagemagick libproj-dev proj-bin libjemalloc2 && \
gem install bundler:2.4.9

WORKDIR /app

COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/
COPY --from=builder /usr/local/bundle /usr/local/bundle
COPY --from=builder /app /app

ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2 \
ENV LD_PRELOAD="libjemalloc.so.2" \
MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:5000,muzzy_decay_ms:5000,narenas:2"

EXPOSE 3000
Expand Down
18 changes: 11 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@

source "https://rubygems.org"

DECIDIM_VERSION = "0.26"
DECIDIM_BRANCH = "release/#{DECIDIM_VERSION}-stable"
DECIDIM_VERSION = "0.27"
DECIDIM_BRANCH = "release/#{DECIDIM_VERSION}-stable".freeze

ruby RUBY_VERSION

# Many gems depend on environment variables, so we load them as soon as possible
gem "dotenv-rails", require: "dotenv/rails-now"

# Core gems
gem "decidim", "~> #{DECIDIM_VERSION}.0"
gem "decidim-conferences", "~> #{DECIDIM_VERSION}.0"
gem "decidim-initiatives", "~> #{DECIDIM_VERSION}.0"
gem "decidim-templates", "~> #{DECIDIM_VERSION}.0"

# External Decidim gems
gem "decidim-cache_cleaner"
gem "decidim-decidim_awesome"
gem "decidim-extended_socio_demographic_authorization_handler", git: "https://github.com/OpenSourcePolitics/decidim-module-extended_socio_demographic_authorization_handler.git",
branch: DECIDIM_BRANCH
gem "decidim-extra_user_fields", git: "https://github.com/paulinebessoles/decidim-module-extra_user_fields", branch: "feat/add_tests_0_27"
gem "decidim-friendly_signup", git: "https://github.com/OpenSourcePolitics/decidim-module-friendly_signup.git"
gem "decidim-gallery"
# TODO: Bump to 0.27.0 when released
# gem "decidim-gallery"
gem "decidim-homepage_interactive_map", git: "https://github.com/OpenSourcePolitics/decidim-module-homepage_interactive_map.git", branch: DECIDIM_BRANCH
gem "decidim-ludens", git: "https://github.com/OpenSourcePolitics/decidim-ludens.git", branch: DECIDIM_BRANCH
gem "decidim-phone_authorization_handler", git: "https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler", branch: DECIDIM_BRANCH
gem "decidim-spam_detection"
gem "decidim-term_customizer", git: "https://github.com/armandfardeau/decidim-module-term_customizer.git", branch: "fix/precompile-on-docker-0.26"
gem "decidim-term_customizer", git: "https://github.com/armandfardeau/decidim-module-term_customizer.git", branch: "fix/precompile-on-docker"

# Omniauth gems
gem "omniauth-france_connect", git: "https://github.com/OpenSourcePolitics/omniauth-france_connect"
Expand All @@ -35,6 +37,8 @@ gem "activejob-uniqueness", require: "active_job/uniqueness/sidekiq_patch"
gem "aws-sdk-s3", require: false
gem "bootsnap", "~> 1.4"
gem "deepl-rb", require: "deepl"
gem "deface"
gem "dotenv-rails", "~> 2.7"
gem "faker", "~> 2.14"
gem "fog-aws"
gem "foundation_rails_helper", git: "https://github.com/sgruhier/foundation_rails_helper.git"
Expand Down
Loading