Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Jun 22, 2021
2 parents b48160c + 5f1dd43 commit 1aac800
Show file tree
Hide file tree
Showing 22 changed files with 1,794 additions and 28 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master, cedeql ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master, cedeql ]
schedule:
- cron: '29 6 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
31 changes: 29 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [1.0.0](https://github.com/Terradue/DotNetStac/compare/1.0.0-rc.4...1.0.0)
## [1.1.0](https://github.com/Terradue/DotNetStac/compare/1.0.0...1.1.0)

### Merged

- Code QL analysis [`#9`](https://github.com/Terradue/DotNetStac/pull/9)

### Commits

- Stac Items clone functions [`6f37ac4`](https://github.com/Terradue/DotNetStac/commit/6f37ac4c5d9af6139bd3773a868fb83d492d2091)
- tests order [`ceb7ad5`](https://github.com/Terradue/DotNetStac/commit/ceb7ad514c793f22f70a70ae99d4c63ec38fc52d)
- Create codeql-analysis.yml [`d3890fe`](https://github.com/Terradue/DotNetStac/commit/d3890fee3f829f1ea27e0e61d6cfffca80cacb68)
- do not load schema at extension load [`8b3884b`](https://github.com/Terradue/DotNetStac/commit/8b3884b0c7060e437950f98df7e951bca36a8a93)
- GetCollection [`d94457d`](https://github.com/Terradue/DotNetStac/commit/d94457da52d2084d2ce5ede79c9764d4243b8a71)
- more formatting [`77c0722`](https://github.com/Terradue/DotNetStac/commit/77c07227a2e1a8c983814c2206fb4f8e95618a71)
- removed profile [`b40f4e0`](https://github.com/Terradue/DotNetStac/commit/b40f4e0d967720296bb852aab6803214343d990b)
- moved in workflow folder [`baf822b`](https://github.com/Terradue/DotNetStac/commit/baf822be0cc188ce49f8a68735b7e8d0ea725313)
- cedeql [`ed83c03`](https://github.com/Terradue/DotNetStac/commit/ed83c0347ed2f5540b8e69606f4e4354d3b4f2fa)

## [1.0.0](https://github.com/Terradue/DotNetStac/compare/1.0.0-rc.4...1.0.0) - 2021-06-07

### Commits

Expand Down Expand Up @@ -35,12 +53,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- convertible array [`b0386b6`](https://github.com/Terradue/DotNetStac/commit/b0386b621f91aa5a6cc1a35cdc7f8dbe7d3400a3)

## [1.0.0-rc.1](https://github.com/Terradue/DotNetStac/compare/0.9.1...1.0.0-rc.1) - 2021-05-26
## [1.0.0-1](https://github.com/Terradue/DotNetStac/compare/0.9.1...1.0.0-1) - 2021-06-07

### Commits

- do not load schema at extension load [`8b3884b`](https://github.com/Terradue/DotNetStac/commit/8b3884b0c7060e437950f98df7e951bca36a8a93)
- SATC 1.0.0! [`fddd916`](https://github.com/Terradue/DotNetStac/commit/fddd9169bd51063c2f23034fffbc43c920409bb1)
- format checking [`f7c1bd1`](https://github.com/Terradue/DotNetStac/commit/f7c1bd1e39c0b3156c89bc268189b27d4cd6127d)
- fixed version extension [`820f5e0`](https://github.com/Terradue/DotNetStac/commit/820f5e011f2952da0f850a3cbc669874264b5d23)
- stac 1.0.0! [`e083b45`](https://github.com/Terradue/DotNetStac/commit/e083b45feea591604133013814ccba8c7215b060)
- API home page [`fddef27`](https://github.com/Terradue/DotNetStac/commit/fddef27b6a91c431c3d3bfd658d5f267baebff67)
- more coverage for eo extension [`ab73316`](https://github.com/Terradue/DotNetStac/commit/ab733160535d44c4df85b18ebce63f69ff436d1a)
- cloud cover nullable [`246f536`](https://github.com/Terradue/DotNetStac/commit/246f5367df481cdd88ea2a0b7ea27de11a404cef)
- fixes for assets [`c9fe721`](https://github.com/Terradue/DotNetStac/commit/c9fe721657f1750abccf1ee85f27c2255bd46046)
- convertible array [`b0386b6`](https://github.com/Terradue/DotNetStac/commit/b0386b621f91aa5a6cc1a35cdc7f8dbe7d3400a3)
- linting [`38a998b`](https://github.com/Terradue/DotNetStac/commit/38a998ba12970bf8a3353c40c14c842d721f0a1f)

## [0.9.1](https://github.com/Terradue/DotNetStac/compare/0.9.0...0.9.1) - 2021-05-26

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

<h3 align="center">

![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=hotfix/1.0.0-1)
![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=release/1.1.0)
[![NuGet](https://img.shields.io/nuget/vpre/DotNetStac)](https://www.nuget.org/packages/DotNetStac/)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/hotfix/1.0.0-1/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/release/1.1.0/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![Gitter](https://img.shields.io/gitter/room/SpatioTemporal-Asset-Catalog/Lobby?color=yellow)](https://gitter.im/SpatioTemporal-Asset-Catalog/Lobby)
[![License](https://img.shields.io/badge/license-AGPL3-blue.svg)](LICENSE)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Terradue/DotNetStac/master?filepath=example.ipynb)
Expand Down
21 changes: 21 additions & 0 deletions src/DotNetStac.Test/Catalog/CatalogTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,26 @@ public void CatalogStacObjectLink()
StacObjectLink stacObjectLink = (StacObjectLink)StacLink.CreateObjectLink(simpleCollection, new Uri("file:///test"));
}

[Fact]
public void CatalogClone()
{
var simpleJson = GetJson("Catalog", "CanDeserializeMinimalSample");
ValidateJson(simpleJson);
StacCatalog simpleCollection = StacConvert.Deserialize<StacCatalog>(simpleJson);
StacCatalog simpleCollectionClone = new StacCatalog(simpleCollection);

var clonedJson = JsonConvert.SerializeObject(simpleCollectionClone);
ValidateJson(clonedJson);

JsonAssert.AreEqual(simpleJson, clonedJson);

simpleCollectionClone = (StacCatalog)simpleCollection.Clone();

clonedJson = JsonConvert.SerializeObject(simpleCollectionClone);
ValidateJson(clonedJson);

JsonAssert.AreEqual(simpleJson, clonedJson);
}

}
}
19 changes: 19 additions & 0 deletions src/DotNetStac.Test/Collection/CollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,26 @@ public void CollectionStacObjectLink()
StacObjectLink stacObjectLink = (StacObjectLink)StacLink.CreateObjectLink(simpleCollection, new Uri("file:///test"));
}

[Fact]
public void CollectionClone()
{
var simpleJson = GetJson("Collection");
ValidateJson(simpleJson);
StacCollection simpleCollection = StacConvert.Deserialize<StacCollection>(simpleJson);
StacCollection simpleCollectionClone = new StacCollection(simpleCollection);

var clonedJson = StacConvert.Serialize(simpleCollectionClone);
ValidateJson(clonedJson);

JsonAssert.AreEqual(simpleJson, clonedJson);

simpleCollectionClone = (StacCollection)simpleCollection.Clone();

clonedJson = StacConvert.Serialize(simpleCollectionClone);
ValidateJson(clonedJson);

JsonAssert.AreEqual(simpleJson, clonedJson);
}

}
}
22 changes: 22 additions & 0 deletions src/DotNetStac.Test/Item/ItemTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,27 @@ public void Geometry()
// extent = StacGeometryHelpers.GetBoundingBox(gcollection);
// Assert.Equal<IPosition>(extentCheck.First().ToArray(), extent);
}

[Fact]
public void ItemClone()
{
var simpleJson = GetJson("Item", "ItemCloneIn");
ValidateJson(simpleJson);
StacItem simpleItem = StacConvert.Deserialize<StacItem>(simpleJson);
StacItem simpleItemClone = new StacItem(simpleItem);

var clonedJson = StacConvert.Serialize(simpleItemClone);
ValidateJson(clonedJson);

var expectedJson = GetJson("Item");
JsonAssert.AreEqual(simpleJson, expectedJson);

simpleItemClone = (StacItem)simpleItem.Clone();

clonedJson = StacConvert.Serialize(simpleItemClone);
ValidateJson(clonedJson);

JsonAssert.AreEqual(simpleJson, expectedJson);
}
}
}
20 changes: 17 additions & 3 deletions src/DotNetStac.Test/JsonAssert.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Linq;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
Expand All @@ -25,16 +28,27 @@ public static void AreEqual(string expectJson, string actualJson)
JsonConvert.SerializeObject(JObject.Parse(expectJson).SortProperties(),
new JsonSerializerSettings
{
DateTimeZoneHandling = DateTimeZoneHandling.Utc
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
Culture = CultureInfo.CreateSpecificCulture("en-US"),
Converters = GetConverters()
}),
JsonConvert.SerializeObject(JObject.Parse(actualJson).SortProperties(),
new JsonSerializerSettings
{
DateTimeZoneHandling = DateTimeZoneHandling.Utc
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
Culture = CultureInfo.CreateSpecificCulture("en-US"),
Converters = GetConverters()
})
);
}

private static IList<JsonConverter> GetConverters()
{
return new List<JsonConverter>()
{
};
}

/// <summary>
/// Asserts that <paramref name="actualJson" /> contains <paramref name="expectedJson" />
/// </summary>
Expand Down
Loading

0 comments on commit 1aac800

Please sign in to comment.