dsmiley commented on code in PR #4103: URL: https://github.com/apache/solr/pull/4103#discussion_r2766878693
########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files Review Comment: lets precisely reference the file path ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files +- We use the "cutterslade-analyze" plugin which requires explicit recording of all dependencies in a build.gradle file Review Comment: This bullet RE cutterslade doesn't appear actionable to the LLM. Our overly thorough build checks will let an LLM or human know when things are amiss. ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files +- We use the "cutterslade-analyze" plugin which requires explicit recording of all dependencies in a build.gradle file +- Always run "gradlew updateLicenses resolveAndLockAll --write-locks" after adding or changing a dependency. See dev-docs/gradle-help/dependencies.txt for more info + +## Build and Development Workflow + +- Always run "gradlew tidy" after editing files Review Comment: This can be slow-ish... I wish we had an optimized variant that only tidy'ed modified source files. I wouldn't recommend someone or LLM waste time/tokens after editing each ... and... every ... file. I wish formatting compliance could happen automatically. Any way.... maybe we shouldn't say anything here, assuming a user will tidy *or* they see the build fails and the build _tells_ the user/llm what to do plainly enough. ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files +- We use the "cutterslade-analyze" plugin which requires explicit recording of all dependencies in a build.gradle file +- Always run "gradlew updateLicenses resolveAndLockAll --write-locks" after adding or changing a dependency. See dev-docs/gradle-help/dependencies.txt for more info + +## Build and Development Workflow + +- Always run "gradlew tidy" after editing files +- Always run "gradlew check -x test" before declaring a feature done +- Respect our .editorconfig Review Comment: .editorconfig is for editor software. I don't think it's meaningful to tell users/llms this. ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files +- We use the "cutterslade-analyze" plugin which requires explicit recording of all dependencies in a build.gradle file +- Always run "gradlew updateLicenses resolveAndLockAll --write-locks" after adding or changing a dependency. See dev-docs/gradle-help/dependencies.txt for more info + +## Build and Development Workflow + +- Always run "gradlew tidy" after editing files +- Always run "gradlew check -x test" before declaring a feature done +- Respect our .editorconfig + +## Code Quality and Best Practices + +- Use the project's custom EnvUtils to read system properties. It auto converts env.var SOLR_FOO_BAR to system property solr.foo.bar +- If you add slf4j log calls, make sure to wrap in logger.isXxxEnabled() clause. Be careful to not add unnecessary logging Review Comment: We needn't declare this. Firstly, it will overdo it, which I can't stand. Secondly, our overly thorough build validation will tell a user/llm _anyway_. ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license Review Comment: Lets instead refer the LLM to `dev-docs/gradle-help/dependencies.txt` as our definitive project guide on dependencies. Besides... maybe I'm being naive but I don't think it's too likely there will be an accident/problem that this bullet will help. And my thinking in this file is concise relevant information. ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files +- We use the "cutterslade-analyze" plugin which requires explicit recording of all dependencies in a build.gradle file +- Always run "gradlew updateLicenses resolveAndLockAll --write-locks" after adding or changing a dependency. See dev-docs/gradle-help/dependencies.txt for more info + +## Build and Development Workflow + +- Always run "gradlew tidy" after editing files +- Always run "gradlew check -x test" before declaring a feature done +- Respect our .editorconfig + +## Code Quality and Best Practices + +- Use the project's custom EnvUtils to read system properties. It auto converts env.var SOLR_FOO_BAR to system property solr.foo.bar +- If you add slf4j log calls, make sure to wrap in logger.isXxxEnabled() clause. Be careful to not add unnecessary logging +- Validate user input. For file paths, always call myCoreContainer.assertPathAllowed(myPath) before using + +## Testing + +- When adding new unit tests, avoid using the old TestHarness and consider using EmbeddedSolrServerTestRule +- See dev-docs/gradle-help/tests.txt for hints on running tests + +## Documentation + +- For major or breaking changes, add a prominent note in reference guide major-changes-in-solr-X.adoc +- Always consider whether a reference-guide page needs updating due to the new/changed features. Target audience is end user +- For changes to build system and other developer-focused changes, consider updating or adding docs in dev-docs/ folder +- Keep all documentation including javadoc concise + +## Changelog + +- We use logchange as changelog tool. Add a new file changelog/unreleased/describe-your-feature.yml for each change, see dev-docs/changelog.adoc Review Comment: It won't know/care what some obscure github project "logchange" is. What matters is we have a command that will write a template file that will need editing. We can/should make that template better (expect a PR from me soon). That command belongs here. ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files +- We use the "cutterslade-analyze" plugin which requires explicit recording of all dependencies in a build.gradle file +- Always run "gradlew updateLicenses resolveAndLockAll --write-locks" after adding or changing a dependency. See dev-docs/gradle-help/dependencies.txt for more info + +## Build and Development Workflow + +- Always run "gradlew tidy" after editing files +- Always run "gradlew check -x test" before declaring a feature done +- Respect our .editorconfig + +## Code Quality and Best Practices + +- Use the project's custom EnvUtils to read system properties. It auto converts env.var SOLR_FOO_BAR to system property solr.foo.bar +- If you add slf4j log calls, make sure to wrap in logger.isXxxEnabled() clause. Be careful to not add unnecessary logging +- Validate user input. For file paths, always call myCoreContainer.assertPathAllowed(myPath) before using + +## Testing + +- When adding new unit tests, avoid using the old TestHarness and consider using EmbeddedSolrServerTestRule Review Comment: ```suggestion - When adding a test to an existing suite/file, keep the same style / design choices - When adding a *new* Java test suite/file: - Subclass SolrTestCase, or if SolrCloud is needed then SolrCloudTestCase - If SolrTestCase and need to embed Solr, use either EmbeddedSolrServerTestRule (doesn't use HTTP) or SolrJettyTestRule if HTTP/Jetty is relevant to what is being tested. - Avoid SolrTestCaseJ4 for new tests ``` ########## AGENTS.md: ########## @@ -0,0 +1,55 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +# AGENTS.md for Apache Solr + +While README.md and CONTRIBUTING.md are mainly written for humans, this file is a condensed knowledge base for coding agents on the Solr codebase. For background, see https://agents.md + +## Licensing and Dependencies + +- Follow Apache Software Foundation licensing rules, avoid adding a dependency with a banned license +- Always apply the Apache License to new source files +- We use gradle version-catalog toml file to encode dependency versions, never add versions directly to build.gradle files +- We use the "cutterslade-analyze" plugin which requires explicit recording of all dependencies in a build.gradle file +- Always run "gradlew updateLicenses resolveAndLockAll --write-locks" after adding or changing a dependency. See dev-docs/gradle-help/dependencies.txt for more info + +## Build and Development Workflow + +- Always run "gradlew tidy" after editing files +- Always run "gradlew check -x test" before declaring a feature done +- Respect our .editorconfig + +## Code Quality and Best Practices + +- Use the project's custom EnvUtils to read system properties. It auto converts env.var SOLR_FOO_BAR to system property solr.foo.bar +- If you add slf4j log calls, make sure to wrap in logger.isXxxEnabled() clause. Be careful to not add unnecessary logging +- Validate user input. For file paths, always call myCoreContainer.assertPathAllowed(myPath) before using + +## Testing + +- When adding new unit tests, avoid using the old TestHarness and consider using EmbeddedSolrServerTestRule +- See dev-docs/gradle-help/tests.txt for hints on running tests + +## Documentation + +- For major or breaking changes, add a prominent note in reference guide major-changes-in-solr-X.adoc +- Always consider whether a reference-guide page needs updating due to the new/changed features. Target audience is end user +- For changes to build system and other developer-focused changes, consider updating or adding docs in dev-docs/ folder +- Keep all documentation including javadoc concise + Review Comment: ```suggestion - New classes should have some javadocs - Changes should not have code comments communicating the change, which are instead great comments to leave for code review / commentary ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
