From e501eebb178777787cc257a1ede3329748cc4907 Mon Sep 17 00:00:00 2001 From: Dan Halson Date: Tue, 11 Feb 2025 14:17:49 +0000 Subject: [PATCH 1/4] DevOps: Fix ruby-lsp --- .devcontainer/devcontainer.json | 7 +++++++ Dockerfile | 10 +++++----- Gemfile | 1 - Gemfile.lock | 1 - 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e33c14fc..ff451322 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -76,6 +76,13 @@ }, "rubyLsp.enabledFeatures": { "diagnostics": true + }, + "rubyLsp.rubyVersionManager": { + "identifier": "none" + }, + "rubyLsp.rubyExecutablePath": "/usr/local/bin/ruby", + "rubyLsp.featureFlags": { + "launcher": false // ruby-lsp v0.17 will fail with this flag enabled } } } diff --git a/Dockerfile b/Dockerfile index 5de43011..fff15db9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,11 +31,11 @@ FROM builder AS dev-container RUN apt-get update \ && apt-get install --yes --no-install-recommends sudo git vim zsh ssh curl less RUN sh -c "$(curl -L https://github.com/deluan/zsh-in-docker/releases/download/v1.1.5/zsh-in-docker.sh)" -- \ - -t robbyrussell \ - -p git -p docker-compose -p yarn \ - -p https://github.com/zsh-users/zsh-autosuggestions \ - # -p https://github.com/marlonrichert/zsh-autocomplete \ - -p https://github.com/unixorn/fzf-zsh-plugin + -t robbyrussell \ + -p git -p docker-compose -p yarn \ + -p https://github.com/zsh-users/zsh-autosuggestions \ + -p https://github.com/marlonrichert/zsh-autocomplete \ + -p https://github.com/unixorn/fzf-zsh-plugin RUN chsh -s $(which zsh) ${USER} # Slim application image without development dependencies diff --git a/Gemfile b/Gemfile index 85dcad2b..094d0c96 100644 --- a/Gemfile +++ b/Gemfile @@ -57,7 +57,6 @@ end group :development do gem 'awesome_print' gem 'rails-erd' - gem 'ruby-lsp', '~> 0.17.7' gem 'ruby-lsp-rails' gem 'ruby-lsp-rspec' end diff --git a/Gemfile.lock b/Gemfile.lock index fb8f24d9..6bda5a54 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -565,7 +565,6 @@ DEPENDENCIES rubocop-graphql rubocop-rails rubocop-rspec - ruby-lsp (~> 0.17.7) ruby-lsp-rails ruby-lsp-rspec scout_apm From ba20acd22d2cdc70c891a20ac1df2e7a22f44a80 Mon Sep 17 00:00:00 2001 From: Dan Halson Date: Tue, 11 Feb 2025 14:31:42 +0000 Subject: [PATCH 2/4] DevOps: Put the bundle on a volume --- .devcontainer/docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index c43b9d2c..9ee6e84a 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -9,6 +9,9 @@ services: - ${HOME}/.ssh:/root/.ssh:ro # To share any ssh keys with the container - /var/run/docker.sock:/var/run/docker.sock - node_modules:/app/node_modules + - bundle:/usr/local/bundle volumes: node_modules: null + postgres_data: + bundle: null From 0ce48b9aa283fbdb3c751989ba0cf2ba3767aed8 Mon Sep 17 00:00:00 2001 From: Dan Halson Date: Wed, 19 Feb 2025 09:05:11 +0000 Subject: [PATCH 3/4] DevOps: Make SMEE_TUNNEL var configurable, fix default terminal, put bundle in volume --- .devcontainer/devcontainer.json | 10 +++++++--- .devcontainer/docker-compose.yml | 4 ++-- .env.example | 1 + docker-compose.yml | 2 ++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ff451322..ce440b76 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -28,9 +28,8 @@ }, // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [ - 3009 - ], + // "forwardPorts": [ + // ], // Uncomment the next line if you want start specific services in your Docker Compose config. // "runServices": [], @@ -77,6 +76,11 @@ "rubyLsp.enabledFeatures": { "diagnostics": true }, + "terminal.integrated.profiles.linux": { + "sh": { + "path": "/bin/zsh" + } + }, "rubyLsp.rubyVersionManager": { "identifier": "none" }, diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 9ee6e84a..517fbcd8 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -12,6 +12,6 @@ services: - bundle:/usr/local/bundle volumes: - node_modules: null + node_modules: postgres_data: - bundle: null + bundle: diff --git a/.env.example b/.env.example index 173e415e..bfca76fe 100644 --- a/.env.example +++ b/.env.example @@ -9,6 +9,7 @@ AWS_SECRET_ACCESS_KEY=changeme GITHUB_WEBHOOK_SECRET=test_token GITHUB_WEBHOOK_REF="refs/heads/draft" +# GITHUB_AUTH_TOKEN="" # Only needed if testing editor builds with Github Api POSTGRES_HOST=db POSTGRES_PASSWORD=password diff --git a/docker-compose.yml b/docker-compose.yml index 3ab356b1..85fd0eef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,6 +43,8 @@ services: image: deltaprojects/smee-client platform: linux/amd64 command: -u $SMEE_TUNNEL -t http://api:3009/github_webhooks + environment: + - SMEE_TUNNEL volumes: postgres-data: From 2bfb4849ae9c9cd5aa1eff8da0d9121ba79743fa Mon Sep 17 00:00:00 2001 From: Dan Halson Date: Tue, 25 Feb 2025 10:53:11 +0000 Subject: [PATCH 4/4] Don't move bundle to a volume yet --- .devcontainer/devcontainer.json | 15 --------------- .devcontainer/docker-compose.yml | 2 -- Gemfile | 1 + Gemfile.lock | 23 ++++++++++++----------- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ce440b76..99d79eca 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -72,21 +72,6 @@ "terminal.integrated.defaultProfile.linux": "zsh", "editor.codeActionsOnSave": { "source.fixAll": "explicit" - }, - "rubyLsp.enabledFeatures": { - "diagnostics": true - }, - "terminal.integrated.profiles.linux": { - "sh": { - "path": "/bin/zsh" - } - }, - "rubyLsp.rubyVersionManager": { - "identifier": "none" - }, - "rubyLsp.rubyExecutablePath": "/usr/local/bin/ruby", - "rubyLsp.featureFlags": { - "launcher": false // ruby-lsp v0.17 will fail with this flag enabled } } } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 517fbcd8..c9f57f1b 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -9,9 +9,7 @@ services: - ${HOME}/.ssh:/root/.ssh:ro # To share any ssh keys with the container - /var/run/docker.sock:/var/run/docker.sock - node_modules:/app/node_modules - - bundle:/usr/local/bundle volumes: node_modules: postgres_data: - bundle: diff --git a/Gemfile b/Gemfile index 094d0c96..66d636a8 100644 --- a/Gemfile +++ b/Gemfile @@ -57,6 +57,7 @@ end group :development do gem 'awesome_print' gem 'rails-erd' + gem 'ruby-lsp' gem 'ruby-lsp-rails' gem 'ruby-lsp-rspec' end diff --git a/Gemfile.lock b/Gemfile.lock index 6bda5a54..12697c1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -236,8 +236,8 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - language_server-protocol (3.17.0.3) - logger (1.6.0) + language_server-protocol (3.17.0.4) + logger (1.6.6) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -304,7 +304,7 @@ GEM postmark-rails (0.22.1) actionmailer (>= 3.0.0) postmark (>= 1.21.3, < 2.0) - prism (0.30.0) + prism (1.3.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -367,7 +367,7 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rbs (3.5.2) + rbs (3.8.1) logger rdoc (6.7.0) psych (>= 4.0.0) @@ -426,15 +426,15 @@ GEM rubocop-capybara (~> 2.17) ruby-graphviz (1.2.5) rexml - ruby-lsp (0.17.7) + ruby-lsp (0.23.11) language_server-protocol (~> 3.17.0) - prism (>= 0.29.0, < 0.31) + prism (>= 1.2, < 2.0) rbs (>= 3, < 4) sorbet-runtime (>= 0.5.10782) - ruby-lsp-rails (0.3.10) - ruby-lsp (>= 0.17.2, < 0.18.0) - ruby-lsp-rspec (0.1.12) - ruby-lsp (~> 0.17.0) + ruby-lsp-rails (0.4.0) + ruby-lsp (>= 0.23.0, < 0.24.0) + ruby-lsp-rspec (0.1.22) + ruby-lsp (~> 0.23.0) ruby-progressbar (1.11.0) ruby-vips (2.2.0) ffi (~> 1.12) @@ -473,7 +473,7 @@ GEM snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) - sorbet-runtime (0.5.11481) + sorbet-runtime (0.5.11856) sprockets (4.2.0) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -565,6 +565,7 @@ DEPENDENCIES rubocop-graphql rubocop-rails rubocop-rspec + ruby-lsp ruby-lsp-rails ruby-lsp-rspec scout_apm