-
Notifications
You must be signed in to change notification settings - Fork 808
SOLR-18076 Agents.md for solr #4103
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
Open
janhoy
wants to merge
16
commits into
apache:main
Choose a base branch
from
janhoy:SOLR-18076-agents-md
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+66
−1
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
60ddc65
First version draft
janhoy 9908781
More precise tidy instruction
janhoy efab8a6
add javadocs, do not add comment to mention the change
janhoy 773f133
how to create tests, what to avoid
janhoy 00f063a
Link to gradle/libs.versions.toml
janhoy 1b35620
Rename plugin mention from cutterslade to gradle-dependency-analyze
janhoy 0c3a282
slf4j
janhoy 5482756
Changelog
janhoy f0d824f
Merge branch 'main' into SOLR-18076-agents-md
janhoy fd18576
Update how-to-contribute.adoc
janhoy caaedc7
Expand intro text, link to hot-to-contribute
janhoy 3afe3c5
Update AGENTS.md
janhoy b3af6f6
Bom
janhoy 78942a8
Changelog
janhoy b0cf2f9
Rephrase changelog
janhoy a1bf67b
minor improvements.
dsmiley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| <!-- | ||
| 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 LLM coding agents on the Solr codebase. See https://agents.md for more info and how to make various coding assistants consume this file. Also see `dev-docs/how-to-contribute.adoc` for some guidelines when using genAI to contribute to Solr. | ||
|
|
||
| ## 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 | ||
| - All versions must be delcared in `gradle/libs.versions.toml`, never build.gradle files | ||
| - Try first declaring a dependency without a version (the version might already be in a BOM); and if fails to resolve _then_ specify a version | ||
| - The build may complain with "Dependency analysis found issues.", a category like "usedUndeclaredArtifacts", and a dependency list. Declare or undeclare these dependencies, as the category will imply. The special 'permit*' configurations are a choice of last resort. | ||
| - 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 | ||
|
|
||
| - When done or preparing to commit changes to java source files, be sure to run `gradlew tidy` to format the code | ||
| - Always run `gradlew check -x test` before declaring a feature done | ||
|
|
||
| ## 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 | ||
| - Be careful to not add non-essential logging! If you add slf4j log calls, make sure to wrap debug/trace level calls in `logger.isXxxEnabled()` clause | ||
| - Validate user input. For file paths, always call `myCoreContainer.assertPathAllowed(myPath)` before using | ||
|
|
||
| ## Testing | ||
|
|
||
| - 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 | ||
|
|
||
| - 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 | ||
| - 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 | ||
|
|
||
janhoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Changelog | ||
|
|
||
| - We use the "logchange" tooling to manage our changelog. See `dev-docs/changelog.adoc` for details and conventions | ||
| - To scaffold a new changelog entry, run `gradlew writeChangelog`, and then edit the new file located in `changelog/unreleased/`. | ||
| - Do not add a changelog entry before a JIRA issue or a Github PR is assigned, as one is required. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,8 +64,9 @@ In order to make a new contribution to Solr you will use the fork you have creat | |
|
|
||
| ## Use of AI Coding Assistants | ||
|
|
||
| AI-powered tools (like GitHub Copilot, ChatGPT, etc.) can assist with contributions, but human contributors remain fully responsible for all submitted code and documentation. See the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for the foundation's policy. If you use AI tools: | ||
| AI-powered tools or agents (like GitHub Copilot, ChatGPT, etc.) can assist with contributions, but human contributors remain fully responsible for all submitted code and documentation. See the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for the foundation's policy. If you use AI tools: | ||
|
|
||
| - Do include our `AGENTS.md` file in the LLM's context for best result. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I followed this instruction and added a hook to my |
||
| - Carefully review all generated content for correctness, security, and alignment with Solr's architecture | ||
| - For major AI-assisted contributions, disclose the use of AI tools in your PR description | ||
| - For documentation contributions, prefer concise, human-readable content over verbose AI-generated text | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.