Added support for remote schemas
What
- Added support for remote schemas in
atmosfor manifest validation. - Updated
schemasconfiguration to allow referencing remote schema files, e.g.:schemas: atmos: manifest: "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json"
Why
- This reduces redundancy as, in previous demos, the manifest file had to be copied multiple times. Now, it can be referenced remotely .
References
Summary by CodeRabbit
Summary by CodeRabbit
-
New Features
- Users can now specify remote schema URLs for validation in the
atmos.yamlconfiguration file. - Enhanced stack validation to support downloading schema files directly from a URL.
- Introduced utility functions to validate URLs and extract file names from URLs.
- Users can now specify remote schema URLs for validation in the
-
Documentation
- Updated the "JSON Schema Validation" document to include instructions for specifying remote schemas, along with an example configuration.
-
Bug Fixes
- Improved error messages to inform users about the option to download schema files from URLs if they do not exist locally.
[!WARNING]
Rate limit exceeded
@aknysh has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 52 seconds before requesting another review.
β How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the
@coderabbitai reviewcommand as a PR comment. Alternatively, push new commits to this PR.We recommend that you space out your commits to avoid hitting the rate limit.
π¦ How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.
π₯ Commits
Files that changed from the base of the PR and between eebb3ee453cdb1dd106af588491a144d3840b3a6 and 493579de18465dddcdf93bf7e93845cef354fcf3.
π Walkthrough
π Walkthrough
π Walkthrough
π Walkthrough
π Walkthrough
Walkthrough
The changes in this pull request involve updates to the atmos.yaml configuration file and enhancements to the ValidateStacks function in validate_stacks.go. The atmos.yaml file's manifest URL was changed from a local path to an absolute URL. Additionally, the ValidateStacks function was modified to support downloading the Atmos manifest JSON Schema from a URL, with new error handling and utility functions added to facilitate URL validation and file name extraction.
Changes
| File | Change Summary |
|---|---|
| examples/demo-context/atmos.yaml | Updated manifest URL from local path to absolute URL. |
| internal/exec/validate_stacks.go | Enhanced ValidateStacks function to support downloading manifest from a URL; added error handling. |
| pkg/utils/file_utils.go | Added IsURL and GetFileNameFromURL functions for URL handling; included import for net/url. |
| website/docs/core-concepts/validate/json-schema.mdx | Added new section on specifying remote schemas in validation; included example configuration. |
Possibly related PRs
-
#736: This PR enhances the Atmos configuration by allowing retrieval of configuration files from both
.yamland.yml, which is directly related to the changes made in the main PR that updates theatmos.yamlconfiguration file's manifest URL. -
#741: This PR documents the
helmfileconfiguration options in Atmos, which includes updates to theatmos.yamlfile structure. The changes in the main PR regarding the manifest URL inatmos.yamlare relevant to the broader context of configuring components likehelmfile.
Suggested labels
minor
Suggested reviewers
- osterman
Poem
In the meadow, where rabbits play,
A new URL leads the way.
With stacks validated, oh what a treat,
Downloading schemas, oh so neat!
Hops of joy, we celebrate,
Changes made, oh isnβt it great! πβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
πͺ§ Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@aknysh what do you think about making this the default location for the schema? That way atmos validate always works, even if no schema installed locally.
@aknysh what do you think about making this the default location for the schema? That way
atmos validatealways works, even if no schema installed locally.
I think yes, we can do it We need to think if we always use the remote location and always validate. In which case we need to allow the user to opt-out
In which case we need to allow the user to opt-out
I think they can set the path to /dev/null to "opt out" =)
But at a very least, we should document how to disable it. And also update the documentation to indicate what is the default behavior.
@haitham911 also please update docs here: https://atmos.tools/core-concepts/validate/json-schema
with how to specify remote schemas
@haitham911 please post screenshot of this in action. Please confirm that using files as well as remote URLs both work. Also, this PR is conflicted.
These changes were released in v1.97.0.
@haitham911 we haven't set a default schema.
If you run: atmos describe config, you'll see JSON schema is not set:
"schemas": {
"jsonschema": {},
"cue": {},
"opa": {},
"atmos": {}
},
Full output
atmos describe config
{
"base_path": "./",
"components": {
"terraform": {
"base_path": "components/terraform",
"apply_auto_approve": false,
"append_user_agent": "Atmos/1.99.0 (Cloud Posse; +https://atmos.tools)",
"deploy_run_init": true,
"init_run_reconfigure": true,
"auto_generate_backend_file": false,
"command": ""
},
"helmfile": {
"base_path": "",
"use_eks": true,
"kubeconfig_path": "",
"helm_aws_profile_pattern": "",
"cluster_name_pattern": "",
"command": ""
}
},
"stacks": {
"base_path": "stacks",
"included_paths": [
"deploy/**/*"
],
"excluded_paths": [
"**/_defaults.yaml"
],
"name_pattern": "{stage}",
"name_template": ""
},
"workflows": {
"base_path": ""
},
"logs": {
"file": "/dev/stderr",
"level": "Info"
},
"integrations": {
"atlantis": {}
},
"schemas": {
"jsonschema": {},
"cue": {},
"opa": {},
"atmos": {}
},
"templates": {
"settings": {
"enabled": false,
"sprig": {
"enabled": false
},
"gomplate": {
"enabled": false,
"timeout": 0,
"datasources": null
}
}
},
"settings": {
"list_merge_strategy": ""
},
"initialized": true,
"stacksBaseAbsolutePath": "/Users/erik/Dev/cloudposse/tools/atmos/examples/quick-start-simple/stacks",
"includeStackAbsolutePaths": [
"/Users/erik/Dev/cloudposse/tools/atmos/examples/quick-start-simple/stacks/deploy/**/*"
],
"excludeStackAbsolutePaths": [
"/Users/erik/Dev/cloudposse/tools/atmos/examples/quick-start-simple/stacks/**/_defaults.yaml"
],
"terraformDirAbsolutePath": "/Users/erik/Dev/cloudposse/tools/atmos/examples/quick-start-simple/components/terraform",
"helmfileDirAbsolutePath": "/Users/erik/Dev/cloudposse/tools/atmos/examples/quick-start-simple",
"default": false
}