Skip to content

Commit

Permalink
Release 0.0.11 (2023-07-27)
Browse files Browse the repository at this point in the history
Added
=====

- New option `--simplified-log` added to `odood test` command.
  Thus it is possible to display meaningful log info (log level, logger, message).

Changed
=======

- Command `odood venv reinstall-odoo` now backups old odoo by default.
  But it is possible to disable backup with option `--no-backup`
- Now it is allowed to specify only name of backup to restore database from.
  In this case, Odood will try to find corresponding backup in standard
  backups directory of project.

Fixed
=====

- Correctly handle `--additional-addons` passed for tests
  in case when migration test enabled: update that addons before running tests.
  • Loading branch information
katyukha committed Jul 27, 2023
2 parents fc7b326 + 855bbc2 commit aab5144
Show file tree
Hide file tree
Showing 42 changed files with 308 additions and 679 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'v*.*.*-RC*'

env:
ODOOD_DLANG_COMPILER: ldc-1.32.2
ODOOD_DLANG_COMPILER: ldc-1.33.0

jobs:
build-ubuntu-20_04:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
dc: [dmd-2.102.2, ldc-1.32.2]
dc: [dmd-2.103.1, ldc-1.33.0]

runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
dc: [dmd-2.102.2, ldc-1.32.0]
dc: [dmd-2.103.1, ldc-1.33.0]

runs-on: ${{ matrix.os }}

Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## Release 0.0.11 (2023-07-27)

### Added

- New option `--simplified-log` added to `odood test` command.
Thus it is possible to display meaningful log info (log level, logger, message).

### Changed

- Command `odood venv reinstall-odoo` now backups old odoo by default.
But it is possible to disable backup with option `--no-backup`
- Now it is allowed to specify only name of backup to restore database from.
In this case, Odood will try to find corresponding backup in standard
backups directory of project.

### Fixed

- Correctly handle `--additional-addons` passed for tests
in case when migration test enabled: update that addons before running tests.

---

## Release 0.0.10 (2023-07-08)

### Added
Expand Down
5 changes: 3 additions & 2 deletions dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
"semver": "0.5.0",
"silly": "1.1.1",
"tabletool": "0.5.0",
"thepath": "0.1.7",
"thepath": "0.1.8",
"theprocess": "0.0.1",
"tinyendian": "0.2.0",
"unit-threaded": "2.1.6",
"zipper": "0.0.2"
"zipper": "0.0.3"
}
}
5 changes: 3 additions & 2 deletions subpackages/cli/dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
"requests": "2.1.1",
"semver": "0.5.0",
"tabletool": "0.5.0",
"thepath": "0.1.7",
"thepath": "0.1.8",
"theprocess": "0.0.1",
"tinyendian": "0.2.0",
"unit-threaded": "2.1.6",
"zipper": "0.0.2"
"zipper": "0.0.3"
}
}
7 changes: 0 additions & 7 deletions subpackages/cli/source/odood/cli/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ class App: OdoodProgram {
override int run(ref string[] args) {
try {
return super.run(args);
} catch (OdoodException e) {
// TODO: Use custom colodred formatting for errors
if (enable_debug)
error("Odood Exception catched:\n%s".format(e));
else
error("%s".format(e.msg));
return 1;
} catch (Exception e) {
// TODO: Use custom colodred formatting for errors
if (enable_debug)
Expand Down
17 changes: 8 additions & 9 deletions subpackages/cli/source/odood/cli/commands/addons.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ private import thepath: Path;
private import commandr: Argument, Option, Flag, ProgramArgs;
private import colored;

private import odood.cli.core: OdoodCommand;
private import odood.cli.core: OdoodCommand, OdoodCLIException;
private import odood.lib.project: Project;
private import odood.utils.odoo.serie: OdooSerie;
private import odood.utils.addons.addon: OdooAddon;
private import odood.exception: OdoodException;


enum AddonDisplayType {
Expand Down Expand Up @@ -362,7 +361,7 @@ class CommandAddonsUpdate: OdoodCommand {
if (!args.flag("all")) {
foreach(addon_name; args.args("addon")) {
auto addon = project.addons.getByString(addon_name);
enforce!OdoodException(
enforce!OdoodCLIException(
!addon.isNull,
"%s does not look like addon name or path to addon".format(
addon_name));
Expand Down Expand Up @@ -398,7 +397,7 @@ class CommandAddonsUpdate: OdoodCommand {
}

if (start_again)
project.server.spawn(true);
project.server.start;
}

}
Expand Down Expand Up @@ -440,7 +439,7 @@ class CommandAddonsInstall: OdoodCommand {
OdooAddon[] addons;
foreach(addon_name; args.args("addon")) {
auto addon = project.addons.getByString(addon_name);
enforce!OdoodException(
enforce!OdoodCLIException(
!addon.isNull,
"%s does not look like addon name or path to addon".format(
addon_name));
Expand Down Expand Up @@ -472,7 +471,7 @@ class CommandAddonsInstall: OdoodCommand {
}

if (start_again)
project.server.spawn(true);
project.server.start;
}
}

Expand Down Expand Up @@ -506,7 +505,7 @@ class CommandAddonsUninstall: OdoodCommand {
OdooAddon[] addons;
foreach(addon_name; args.args("addon")) {
auto addon = project.addons.getByString(addon_name);
enforce!OdoodException(
enforce!OdoodCLIException(
!addon.isNull,
"%s does not look like addon name or path to addon".format(
addon_name));
Expand All @@ -532,7 +531,7 @@ class CommandAddonsUninstall: OdoodCommand {
}

if (start_again)
project.server.spawn(true);
project.server.start;
}
}

Expand Down Expand Up @@ -589,7 +588,7 @@ class CommandAddonsIsInstalled: OdoodCommand {
auto project = Project.loadProject;

auto addon_n = project.addons.getByString(args.arg("addon"));
enforce!OdoodException(
enforce!OdoodCLIException(
!addon_n.isNull,
"Cannot find addon %s".format(args.arg("addon")));
auto addon = addon_n.get();
Expand Down
1 change: 0 additions & 1 deletion subpackages/cli/source/odood/cli/commands/ci.d
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ private import commandr: Argument, Option, Flag, ProgramArgs;

private import odood.cli.core: OdoodCommand;
private import odood.lib.project: Project;
private import odood.exception: OdoodException;
private import odood.lib.odoo.utils: fixVersionConflict;


Expand Down
21 changes: 8 additions & 13 deletions subpackages/cli/source/odood/cli/commands/database.d
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ private import std.typecons;
private import thepath: Path;
private import commandr: Argument, Option, Flag, ProgramArgs;

private import odood.cli.core: OdoodCommand, exitWithCode;
private import odood.cli.core: OdoodCommand, exitWithCode, OdoodCLIException;
private import odood.lib.project: Project;
private import odood.lib.odoo.lodoo: BackupFormat;
private import odood.utils.odoo.serie: OdooSerie;
private import odood.utils: generateRandomString;
private import odood.utils.addons.addon: OdooAddon;

// TODO: Use specific exception tree for CLI part
private import odood.exception: OdoodException;


class CommandDatabaseList: OdoodCommand {
Expand Down Expand Up @@ -72,7 +70,7 @@ class CommandDatabaseCreate: OdoodCommand {
OdooAddon[] to_install;
foreach(addon_name; args.options("install")) {
auto addon = project.addons.getByName(addon_name);
enforce!OdoodException(
enforce!OdoodCLIException(
!addon.isNull,
"Cannot find addon %s".format(addon_name));
to_install ~= addon.get;
Expand All @@ -90,7 +88,7 @@ class CommandDatabaseCreate: OdoodCommand {
"(because --recreate option specified).", dbname);
project.databases.drop(dbname);
} else {
throw new OdoodException(
throw new OdoodCLIException(
"Database %s already exists!".format(dbname));
}
}
Expand Down Expand Up @@ -200,7 +198,7 @@ class CommandDatabaseBackup: OdoodCommand {
public override void execute(ProgramArgs args) {
auto project = Project.loadProject;

enforce!OdoodException(
enforce!OdoodCLIException(
args.flag("all") || args.args("name").length > 0,
"It is required to specify name of database to backup or option -a or --all!");

Expand Down Expand Up @@ -237,16 +235,13 @@ class CommandDatabaseRestore: OdoodCommand {
this.add(new Argument(
"name", "Name of database to restore.").required());
this.add(new Argument(
"backup", "Path to backup to restore database from.").required());
"backup", "Path to backup (or name of backup) to restore database from.").required());
}

public override void execute(ProgramArgs args) {
auto project = Project.loadProject;
const auto backup_path = Path(args.arg("backup")).toAbsolute;
const auto backup_path = args.arg("backup");
const string dbname = args.arg("name");
enforce!OdoodException(
backup_path.exists && backup_path.isFile,
"Wrong backup path (%s) specified!".format(backup_path));

bool start_server = false;
if (project.server.isRunning) {
Expand All @@ -261,7 +256,7 @@ class CommandDatabaseRestore: OdoodCommand {
"(because --recreate option specified).", dbname);
project.databases.drop(dbname);
} else {
throw new OdoodException(
throw new OdoodCLIException(
"Database %s already exists!".format(dbname));
}
}
Expand All @@ -280,7 +275,7 @@ class CommandDatabaseRestore: OdoodCommand {
}

if (start_server)
project.server.spawn(true);
project.server.start;
}
}

Expand Down
1 change: 0 additions & 1 deletion subpackages/cli/source/odood/cli/commands/discover.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ private import odood.cli.core: OdoodCommand;
private import odood.lib.project: Project;
private import odood.lib.project.discover: discoverOdooHelper;
private import odood.utils.odoo.serie: OdooSerie;
private import odood.exception: OdoodException;


class CommandDiscoverOdooHelper: OdoodCommand {
Expand Down
5 changes: 2 additions & 3 deletions subpackages/cli/source/odood/cli/commands/init.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ private import std.exception: enforce;
private import thepath: Path;
private import commandr: Option, Flag, ProgramArgs;

private import odood.cli.core: OdoodCommand;
private import odood.cli.core: OdoodCommand, OdoodCLIException;
private import odood.lib.project: Project;
private import odood.lib.odoo.config: initOdooConfig;
private import odood.lib.postgres: createNewPostgresUser;
private import odood.utils.odoo.serie: OdooSerie;
private import odood.exception: OdoodException;


class CommandInit: OdoodCommand {
Expand Down Expand Up @@ -79,7 +78,7 @@ class CommandInit: OdoodCommand {
auto odoo_repo = args.option(
"odoo-repo", "https://github.com/odoo/odoo.git");

enforce!OdoodException(
enforce!OdoodCLIException(
odoo_version.isValid,
"Odoo version %s is not valid".format(args.option("odoo-version")));

Expand Down
8 changes: 3 additions & 5 deletions subpackages/cli/source/odood/cli/commands/script.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ private import commandr: Argument, Option, Flag, ProgramArgs;

private import thepath;

private import odood.cli.core: OdoodCommand;
private import odood.cli.core: OdoodCommand, OdoodCLIException;
private import odood.lib.project: Project;
private import odood.exception: OdoodException;


class CommandScriptPy: OdoodCommand {
Expand All @@ -26,7 +25,7 @@ class CommandScriptPy: OdoodCommand {
auto dbname = args.option("db");
Path script = args.arg("script");

enforce!OdoodException(
enforce!OdoodCLIException(
project.databases.exists(args.option("db")),
"Database %s does not exists!".format(args.option("db")));

Expand All @@ -53,8 +52,7 @@ class CommandScriptSQL: OdoodCommand {
auto dbname = args.option("db");
Path script = args.arg("script");

// TODO: check existense of db via SQL
enforce!OdoodException(
enforce!OdoodCLIException(
project.databases.exists(dbname),
"Database %s does not exists!".format(dbname));

Expand Down
7 changes: 3 additions & 4 deletions subpackages/cli/source/odood/cli/commands/server.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ private import commandr: Option, Flag, ProgramArgs;
private import odood.cli.core: OdoodCommand;
private import odood.lib.project: Project;
private import odood.utils.odoo.serie: OdooSerie;
private import odood.exception: OdoodException;


class CommandServerRun: OdoodCommand {
Expand All @@ -34,7 +33,7 @@ class CommandServerStart: OdoodCommand {

public override void execute(ProgramArgs args) {
auto project = Project.loadProject;
project.server.spawn(true);
project.server.start;
}

}
Expand Down Expand Up @@ -80,7 +79,7 @@ class CommandServerRestart: OdoodCommand {
if (project.server.isRunning)
project.server.stop();

project.server.spawn(true);
project.server.start;
}

}
Expand All @@ -96,7 +95,7 @@ class CommandServerBrowse: OdoodCommand {
import std.process;
auto project = Project.loadProject;
if (!project.server.isRunning)
project.server.spawn(true);
project.server.start;

auto odoo_conf = project.getOdooConfig;

Expand Down
1 change: 0 additions & 1 deletion subpackages/cli/source/odood/cli/commands/status.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ private import commandr: Option, Flag, ProgramArgs;
private import odood.cli.core: OdoodCommand;
private import odood.lib.project: Project;
private import odood.utils.odoo.serie: OdooSerie;
private import odood.exception: OdoodException;


immutable string TMPL_CURRENT_PROJECT_STATUS = "
Expand Down
Loading

0 comments on commit aab5144

Please sign in to comment.