Skip to content
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased [patch]

> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs.

### Fixed

- Validate presence of required configuration for dataset publication to data.gouv.fr

## 10.1.2 - 2025-12-09

_Full changeset and discussions: [#1212](https://github.com/OpenTermsArchive/engine/pull/1212)._
Expand Down
2 changes: 0 additions & 2 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
}
},
"dataset": {
"title": "Sandbox collection dataset",
"versionsRepositoryURL": "https://github.com/OpenTermsArchive/sandbox-declarations",
"publishingSchedule": "30 8 * * MON"
}
}
Expand Down
12 changes: 11 additions & 1 deletion scripts/dataset/publish/datagouv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,21 @@ function loadConfiguration() {
const organizationIdOrSlug = config.has('@opentermsarchive/engine.dataset.datagouv.organizationIdOrSlug') && config.get('@opentermsarchive/engine.dataset.datagouv.organizationIdOrSlug');

if (!datasetId && !organizationIdOrSlug) {
throw new Error('Either datasetId or organizationIdOrSlug is required in config at @opentermsarchive/engine.dataset.datagouv');
throw new Error('Either "datasetId" or "organizationIdOrSlug" is required in config at @opentermsarchive/engine.dataset.datagouv');
}

const datasetTitle = config.get('@opentermsarchive/engine.dataset.title');

if (!datasetTitle) {
throw new Error('"title" is required in config at @opentermsarchive/engine.dataset');
}

const frequency = config.has('@opentermsarchive/engine.dataset.datagouv.frequency') && config.get('@opentermsarchive/engine.dataset.datagouv.frequency');

if (!frequency) {
throw new Error('"frequency" is required in config at @opentermsarchive/engine.dataset.datagouv');
}

const useDemo = config.has('@opentermsarchive/engine.dataset.datagouv.useDemo') && config.get('@opentermsarchive/engine.dataset.datagouv.useDemo');
const apiBaseUrl = useDemo ? DEMO_API_BASE_URL : PRODUCTION_API_BASE_URL;

Expand Down
4 changes: 1 addition & 3 deletions scripts/dataset/publish/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import config from 'config';

import logger from '../logger/index.js';

import publishDataGouv from './datagouv/index.js';
Expand All @@ -16,7 +14,7 @@ export default async function publishRelease({ archivePath, releaseDate, stats }
platforms.push({ name: 'GitLab', publish: () => publishGitLab({ archivePath, releaseDate, stats }) });
}

if (process.env.OTA_ENGINE_DATAGOUV_API_KEY && (config.has('@opentermsarchive/engine.dataset.datagouv.datasetId') || config.has('@opentermsarchive/engine.dataset.datagouv.organizationIdOrSlug'))) {
if (process.env.OTA_ENGINE_DATAGOUV_API_KEY) {
platforms.push({ name: 'data.gouv.fr', publish: () => publishDataGouv({ archivePath, releaseDate, stats }) });
}

Expand Down
Loading