Browse Source

0.90.2 Pre-release (#1733)

* fix: unsafe repository issue in actions/checkout

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* fix: remove extra space

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* docs: fix delete function name

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* fix: remove duplicate and add missing delete api (#1731)

Signed-off-by: mertmit <mertmit99@gmail.com>

* fix: extract correct model id on audit export and ignore table audit if missing meta (#1732)

re #1722

Signed-off-by: Pranav C <pranavxc@gmail.com>

Co-authored-by: Wing-Kam Wong <wingkwong.code@gmail.com>
Co-authored-by: mertmit <mertmit99@gmail.com>
pull/1749/head
Pranav C 3 years ago committed by GitHub
parent
commit
86a2e20166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .github/workflows/sync-to-develop.yml
  2. 2
      README.md
  3. 2
      packages/noco-docs/content/en/developer-resources/rest-apis.md
  4. 2
      packages/noco-docs/content/en/getting-started/installation.md
  5. 4
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts
  6. 29
      packages/nocodb/src/lib/noco/upgrader/NcUpgrader.ts
  7. 16
      packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts

5
.github/workflows/sync-to-develop.yml

@ -9,6 +9,11 @@ jobs:
sync-to-develop: sync-to-develop:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# See https://github.com/actions/checkout/issues/766
- name: Workaround for unsafe repository issue
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Checkout - name: Checkout
uses: actions/checkout@v1 uses: actions/checkout@v1

2
README.md

@ -93,7 +93,7 @@ npm start
```bash ```bash
# for SQLite # for SQLite
docker run -d --name nocodb \ docker run -d --name nocodb \
-v "$(pwd)"/nocodb:/usr/app/data/ \ -v "$(pwd)"/nocodb:/usr/app/data/ \
-p 8080:8080 \ -p 8080:8080 \
nocodb/nocodb:latest nocodb/nocodb:latest

2
packages/noco-docs/content/en/developer-resources/rest-apis.md

@ -50,7 +50,7 @@ Here's the overview of all APIs. For the details, please check out <a href="http
| Data | Post | dbTableRow | create | /api/v1/db/data/{orgs}/{projectName}/{tableName} | | Data | Post | dbTableRow | create | /api/v1/db/data/{orgs}/{projectName}/{tableName} |
| Data | Get | dbTableRow | read | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} | | Data | Get | dbTableRow | read | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Patch | dbTableRow | update | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} | | Data | Patch | dbTableRow | update | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Delete| dbTableRow | modelDelete | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} | | Data | Delete| dbTableRow | delete | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Get | dbTableRow | count | /api/v1/db/data/{orgs}/{projectName}/{tableName}/count | | Data | Get | dbTableRow | count | /api/v1/db/data/{orgs}/{projectName}/{tableName}/count |
| Data | Get | dbViewRow | list | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} | | Data | Get | dbViewRow | list | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} |
| Data | Post | dbViewRow | create | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} | | Data | Post | dbViewRow | create | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} |

2
packages/noco-docs/content/en/getting-started/installation.md

@ -66,7 +66,7 @@ If you are a Docker user, you may try this way!
```bash ```bash
docker run -d --name nocodb \ docker run -d --name nocodb \
-v "$(pwd)"/nocodb:/usr/app/data/ \ -v "$(pwd)"/nocodb:/usr/app/data/ \
-p 8080:8080 \ -p 8080:8080 \
nocodb/nocodb:latest nocodb/nocodb:latest
``` ```

4
packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts

@ -152,9 +152,9 @@ router.patch(
'/api/v1/db/data/:orgs/:projectName/:tableName/:rowId', '/api/v1/db/data/:orgs/:projectName/:tableName/:rowId',
ncMetaAclMw(dataUpdate, 'dataUpdate') ncMetaAclMw(dataUpdate, 'dataUpdate')
); );
router.patch( router.delete(
'/api/v1/db/data/:orgs/:projectName/:tableName/:rowId', '/api/v1/db/data/:orgs/:projectName/:tableName/:rowId',
ncMetaAclMw(dataUpdate, 'dataUpdate') ncMetaAclMw(dataDelete, 'dataDelete')
); );
router.get( router.get(

29
packages/nocodb/src/lib/noco/upgrader/NcUpgrader.ts

@ -8,6 +8,8 @@ import ncProjectUpgraderV2_0090000 from './jobs/ncProjectUpgraderV2_0090000';
const log = debug('nc:upgrader'); const log = debug('nc:upgrader');
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import boxen from 'boxen';
export interface NcUpgraderCtx { export interface NcUpgraderCtx {
ncMeta: NcMetaIO; ncMeta: NcMetaIO;
} }
@ -100,19 +102,40 @@ export default class NcUpgrader {
}); });
} catch (e) { } catch (e) {
await ctx.ncMeta.rollback(e); await ctx.ncMeta.rollback(e);
console.log('Error', e);
Tele.emit('evt', { Tele.emit('evt', {
evt_type: 'appMigration:failed', evt_type: 'appMigration:failed',
from: oldVersion, from: oldVersion,
to: process.env.NC_VERSION, to: process.env.NC_VERSION,
msg: e.message msg: e.message,
err: e?.stack
?.split?.('\n')
.slice(0, 2)
.join('\n')
}); });
console.log(getUpgradeErrorLog(e, oldVersion, process.env.NC_VERSION));
throw e;
} }
} }
private static log(str, ...args): void { private static log(str, ...args): void {
log(`${str}`, ...args); log(`${str}`, ...args);
} }
}
function getUpgradeErrorLog(e: Error, oldVersion: string, newVersion: string) {
const errorTitle = `Migration from ${oldVersion} to ${newVersion} failed`;
return boxen(
`Error
-----
${e.stack}
Please raise an issue in our github by using following link :
https://github.com/nocodb/nocodb/issues/new?labels=Type%3A%20Bug&template=bug_report.md
private; Or contact us in our Discord community by following link :
https://discord.gg/5RgZmkW ( message @o1lab, @pranavxc or @wingkwong )`,
{ title: errorTitle, padding: 1, borderColor: 'yellow' }
);
} }

16
packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts

@ -1282,11 +1282,21 @@ async function migrateAutitLog(
}; };
if (audit.model_name) { if (audit.model_name) {
insertObj.fk_model_id = ( const model =
ctx.objModelAliasRef?.[audit.project_id]?.[audit.model_name] || ctx.objModelAliasRef?.[audit.project_id]?.[audit.model_name] ||
ctx.objModelRef?.[audit.project_id]?.[audit.model_name] || ctx.objModelRef?.[audit.project_id]?.[audit.model_name] ||
ctx.metas?.find(m => m.id == audit.model_id) // extract model by using model_id property from audit
)?.id; ctx.objModelRef?.[audit.project_id]?.[
ctx.metas?.find(m => m.id == audit.model_id)?.title
] ||
ctx.objModelAliasRef?.[audit.project_id]?.[
ctx.metas?.find(m => m.id == audit.model_id)?.alias
];
// if model is not found skip audit insertion
if (!model) continue;
insertObj.fk_model_id = model.id;
} }
await Audit.insert(insertObj, ncMeta); await Audit.insert(insertObj, ncMeta);

Loading…
Cancel
Save