<p></p>
<p><b>@gravitystorm</b> commented on this pull request.</p>
<p dir="auto">This is great, thanks for working on this. It appears to be approximately 600% more complicated to set up than I had expected! Particularly around the selenium stuff.</p>
<p dir="auto">I haven't yet tested it in action, but I've a few questions from reviewing the code. It turns out running devcontainers on vscodium is more difficult than I thought, so I need to figure out some clean way for me to test it without messing up my regular development environment.</p><hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6424#discussion_r2474281685">config/devcontainer.database.yml</a>:</p>
<pre style='color:#555'>> +# variable when you boot the app. For example:
+#
+# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
+#
+# If the connection URL is provided in the special DATABASE_URL environment
+# variable, Rails will automatically merge its configuration values on top of
+# the values provided in this file. Alternatively, you can specify a connection
+# URL environment variable explicitly:
+#
+# production:
+# url: <%= ENV["MY_APP_DATABASE_URL"] %>
+#
+# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
+# for a full overview on how database connection configuration can be specified.
+#
+production:
</pre>
<p dir="auto">I don't think this section is necessary, and it's a bit confusing having references to migration paths that don't exist.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6424#discussion_r2474283837">config/devcontainer.database.yml</a>:</p>
<pre style='color:#555'>> +
+ # Schema search path. The server defaults to $user,public
+ #schema_search_path: myapp,sharedapp,public
+
+ # Minimum log levels, in increasing order:
+ # debug5, debug4, debug3, debug2, debug1,
+ # log, notice, warning, error, fatal, and panic
+ # Defaults to warning.
+ #min_messages: notice
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ <<: *default
+ database: open_street_map_test
</pre>
<p dir="auto">To reduce confusion, I think we should keep the same database names that are used in <code class="notranslate">docker.database.yml</code> and <code class="notranslate">example.database.yml</code></p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6424#discussion_r2474289880">.devcontainer/devcontainer.json</a>:</p>
<pre style='color:#555'>> +
+ // Features to add to the dev container. More info: https://containers.dev/features.
+ "features": {
+ "ghcr.io/devcontainers/features/github-cli:1": {},
+ "ghcr.io/devcontainers/features/node:1": {},
+ "ghcr.io/rails/devcontainer/features/activestorage": {},
+ "ghcr.io/rails/devcontainer/features/postgres-client": {}
+ },
+
+ "containerEnv": {
+ "CAPYBARA_SERVER_PORT": "45678",
+ "DB_HOST": "postgres"
+ },
+
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
+ "forwardPorts": [3000, 5432, 6379],
</pre>
<p dir="auto">3000 = rails app, 5432 = postgres, those seem reasonable. But as I understand it, 6379 is redis, and is that used at all?</p>
<p dir="auto">Also just to check - do the ports get forwarded to the correct containers - specifically does 5432 get forwarded to the postgres container? I'm no expert on container routing.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6424#discussion_r2474303167">DEVCONTAINER.md</a>:</p>
<pre style='color:#555'>> +
+## Other tools
+
+VS Code is not the only way to work with devcontainers. Other options include:
+
+- [RubyMine](https://www.jetbrains.com/help/ruby/start-dev-container-inside-ide.html): another popular environment to work with Ruby.
+- [DevPod](https://devpod.sh): a CLI tool to work with devcontainers.
+
+## Troubleshooting
+
+### `‘ruby’: No such file or directory`
+
+In some cases Ruby may not install correctly. If you see this message, run these two commands:
+
+```
+mise install
</pre>
<p dir="auto">I don't understand what mise is used for, particularly when it's referring to installing ruby. Is the ruby binary not already installed in the container (<code class="notranslate">FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION</code>)?</p>
<p dir="auto">I can see the mise cache being configured, but I can see any mise commands being run here (other than mise trust, see separate comment).</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6424#discussion_r2474304942">.devcontainer/start</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,11 @@
+#!/usr/bin/env sh
+
+# This setup uses https://mise.jdx.dev to manage language versions.
+# Mark the config file as trusted to avoid an interactive prompt.
+mise trust /workspaces/mise.local.toml
</pre>
<p dir="auto">I don't see a <code class="notranslate">mise.local.toml</code> file anywhere - where does it come from? Is it in one of the container images?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6424#pullrequestreview-3394872346">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMVOO5KL4GU6UVUS3D32DY7FAVCNFSM6AAAAACIAUD6DKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTGOJUHA3TEMZUGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKYVBUKLG5U5YJQ6T332DY7FA5CNFSM6AAAAACIAUD6DKWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTWKLGSBU.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/6424/review/3394872346</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/6424#pullrequestreview-3394872346",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6424#pullrequestreview-3394872346",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>