Skip to content
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

Core as subtree #119

Merged
merged 7 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- image: circleci/node:12
steps:
- checkout
- run:
name: init_submodules
command: git submodule update --init --recursive
- save_cache:
key: v0-repo-{{ .Branch }}-{{ .Revision }}
paths:
Expand Down Expand Up @@ -72,6 +69,16 @@ jobs:
command: |
ssh-keyscan github.com >> ~/.ssh/known_hosts
npm run publish-openapi -- $CIRCLE_TAG
check-core-changes:
working_directory: ~/stac
docker:
- image: circleci/node:12
steps:
- *restore_repo
- *restore_dependencies
- run:
name: check-core-changes
command: npm run check-stac-spec-changes --compare-to=<< pipeline.git.base_revision >>

workflows:
version: 2
Expand All @@ -87,6 +94,12 @@ workflows:
filters:
tags:
only: /^v.*/
- check-core-changes:
requires:
- validate
filters:
tags:
only: /^v.*/
- publish:
requires:
- build
Expand Down
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

- [ ] This PR is made against the dev branch (all proposed changes except releases should be against dev, not master).
- [ ] This PR has **no** breaking changes.
- [ ] This PR does not make any changes to the core spec in the `stac-spec` directory (these are included as a subtree and should be updated directly in [radiantearth/stac-spec](https://github.com/radiantearth/stac-spec))
- [ ] I have added my changes to the [CHANGELOG](https://github.com/radiantearth/stac-api-spec/blob/dev/CHANGELOG.md) **or** a CHANGELOG entry is not required.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

4 changes: 2 additions & 2 deletions fragments/itemcollection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This object describes a STAC ItemCollection. The fields `type` and `features` ar
practices](../../stac-spec/best-practices.md#mixing-stac-versions) in mind.

**stac_extensions**: A list of STAC content extensions the ItemCollection implements. The list contains URLs to the JSON Schema files it
can be validated against. For official [content extensions](../../stac-spec/extensions/README.md#list-of-content-extensions), a "shortcut"
can be validated against. For official [STAC extensions](https://stac-extensions.github.io/#list-of-stac-extensions), a "shortcut"
can be used. This means you can specify the folder name of the extension, for example `single-file-stac` for the Single File
STAC extension. This does *not* apply for [API extensions](../../extensions.md). If the versions of the extension and the item diverge,
you can specify the URL of the JSON schema file. This list must only contain extensions that extend the ItemCollection itself, see the
Expand All @@ -41,5 +41,5 @@ the 'Scope' column in the list of extensions. It must not contain extensions tha

- The [Context Extension](../../item-search/README.md#context) adds additional fields to STAC ItemCollection relevant
to their use as search results.
- The [Single File STAC Extension](../../stac-spec/extensions/single-file-stac/README.md) provides a set of Collections and Items
- The [Single File STAC Extension](https://github.com/stac-extensions/single-file-stac/blob/main/README.md) provides a set of Collections and Items
as a single file catalog.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"check-openapi-item-search": "spectral lint item-search/openapi.yaml --ruleset .circleci/.spectral.yml",
"check-openapi-fragments": "spectral lint fragments/*/openapi.yaml --ruleset .circleci/.spectral-fragments.yml",
"build-openapi": ".circleci/build-openapi.sh",
"publish-openapi": "node .circleci/publish.js"
"publish-openapi": "node .circleci/publish.js",
"check-stac-spec-changes": "git diff --quiet HEAD ${npm_config_compare_to} -- stac-spec"
Copy link
Collaborator

@m-mohr m-mohr May 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is meant to be used by CI only, right? As I think this would fail on any other system (at least on Win), maybe just use that command directly in the CI without exposing it as npm script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be run locally (I've been using it to test prior to putting in the PR to avoid unexpected CI failures). You just need to pass in the --compare-to option manually when running it locally:

npm run check-stac-spec-changes --compare-to=master

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would fail on any other system (at least on Win)

You may be right about Windows, I've only tested on Linux and MacOS.

},
"dependencies": {
"@stoplight/spectral": "^5.7.1",
Expand Down
1 change: 0 additions & 1 deletion stac-spec
Submodule stac-spec deleted from 4988a4
53 changes: 53 additions & 0 deletions stac-spec/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2
jobs:
test_examples:
working_directory: ~/stac
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: install
command: npm install
- run:
name: validate
command: npm run check-examples
test_docs:
working_directory: ~/stac
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: install
command: npm install
- run:
name: validate
command: npm run check-markdown
publish_schemas:
working_directory: ~/stac
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: install
command: npm install
- add_ssh_keys:
fingerprints:
- "9b:0a:88:ff:12:d1:29:9a:ff:bb:72:ab:7d:81:df:59"
- run:
name: publish
command: npm run publish-schemas -- $CIRCLE_TAG
workflows:
version: 2
ci:
jobs:
- test_examples
- test_docs
- publish_schemas:
filters:
tags:
only: /^v.*/
branches:
ignore: /^((?!dev).)*$/
40 changes: 40 additions & 0 deletions stac-spec/.circleci/publish-schemas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const klaw = require('klaw-sync');
const path = require('path');
const fs = require('fs');
const ghpages = require('gh-pages');

function filterFn (item) {
const basename = path.basename(item.path);
return basename === '.' || basename === 'node_modules' || basename[0] !== '.';
}

let args = process.argv.slice(2);
let tag = 'dev';
if (args.length && args[0].trim().length > 0) {
tag = args[0];
}

var folder = '.';
var jsonSchemaFolderPattern = path.sep + 'json-schema' + path.sep;
for (let file of klaw(folder, {filter: filterFn})) {
if (file.path.includes(jsonSchemaFolderPattern) && path.extname(file.path) === '.json') {
let source = file.path;
let target = 'schemas' + path.sep + tag + path.sep + path.relative(folder, file.path);
fs.mkdirSync(path.dirname(target), { recursive: true });
fs.copyFileSync(source, target);
console.log(target);
}
}

ghpages.publish('schemas/' + tag, {
src: '**',
dest: tag,
message: 'Publish JSON Schemas [ci skip]',
user: {
name: 'STAC CI',
email: '[email protected]'
}
}, error => {
console.error(error ? error : 'Deployed to gh-pages');
process.exit(error ? 1 : 0);
});
46 changes: 46 additions & 0 deletions stac-spec/.circleci/rc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins:
# Check links
- validate-links
# Apply some recommended defaults for consistency
- remark-preset-lint-consistent
- remark-preset-lint-recommended
# No HTML for security - can't activate yet due to STAC logo in README.md
# - lint-no-html
# General formatting
# - - remark-lint-emphasis-marker
# - '*'
- remark-lint-hard-break-spaces
- remark-lint-blockquote-indentation
- remark-lint-no-consecutive-blank-lines
# Detect overly long lines - be liberal for now and don't restrict to 80 yet
# - - remark-lint-maximum-line-length
# - 150
# Code
- remark-lint-fenced-code-flag
- remark-lint-fenced-code-marker
- remark-lint-no-shell-dollars
- - remark-lint-code-block-style
- 'fenced'
# Headings
- remark-lint-heading-increment
- remark-lint-no-duplicate-headings
- remark-lint-no-multiple-toplevel-headings
- remark-lint-no-heading-punctuation
- - remark-lint-maximum-heading-length
- 70
- - remark-lint-heading-style
- atx
# Lists
- remark-lint-list-item-bullet-indent
- remark-lint-ordered-list-marker-style
- remark-lint-ordered-list-marker-value
- remark-lint-checkbox-character-style
# - - remark-lint-unordered-list-marker-style
# - '-'
- - remark-lint-list-item-indent
- space
# Tables
- remark-lint-table-pipes
# - remark-lint-table-pipe-alignment # Wait for https://github.com/remarkjs/remark-lint/issues/226
# Urls
- remark-lint-no-literal-urls
14 changes: 14 additions & 0 deletions stac-spec/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**Related Issue(s):** #


**Proposed Changes:**

1.
2.

**PR Checklist:**

- [ ] This PR is made against the dev branch (all proposed changes except releases should be against dev, not master).
- [ ] This PR has **no** breaking changes.
- [ ] I have added my changes to the [CHANGELOG](https://github.com/radiantearth/stac-spec/blob/dev/CHANGELOG.md) **or** a CHANGELOG entry is not required.
- [ ] This PR affects the [STAC API spec](https://github.com/radiantearth/stac-api-spec), and I have opened issue/PR #XXX to track the change.
69 changes: 69 additions & 0 deletions stac-spec/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
package-lock.json

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# IntelliJ IDEA files
.idea/
*.iml

# Folder created when CI puhlishes JSON Schemas
schemas/
1 change: 1 addition & 0 deletions stac-spec/.remarkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/CHANGELOG.md
Loading