India Compliance: Changes to Branching and Versioning

Dear Community,

Due to a breaking change in Frappe Framework’s develop branch, we’re no longer able to maintain a single branch (develop) for India Compliance that is compatible with both ERPNext version-14 and develop.

Consequently, we’ve made the following changes:

  • The develop branch has been renamed to version-14. For users who are currently on the develop branch of India Compliance, a bit of manual intervention will be required to continue receiving periodic updates (steps mentioned below).

  • A new branch called version-14-hotfix will serve as the staging area for code that is pending to be released into version-14 (similar to ERPNext). All pull requests intended for version-14 need to be made to this branch.

  • A new branch called next has been created. This will be compatible with ERPNext’s develop branch (we’re currently working on making this compatible).

    next will also be the default branch for all new clones (bench get-app ...). If you want to clone and install a stable version of India Compliance, you will need to use the --branch flag like so:

    bench get-app india-compliance --branch version-14
    

    This is similar to how you would specify branches when fetching the ERPNext app.

  • We’ve also started versioning for India Compliance. To keep the versioning consistent with Frappe and ERPNext, we’ve decided to start with the version 14.0.0.

Steps to switch to desired branch from the develop branch

Execute the following commands from your bench directory (e.g. frappe-bench):

cd apps/india_compliance/
git remote set-branches upstream [branch-name]
git fetch upstream [branch-name]
git checkout -b [branch-name] --track upstream/[branch-name]
cd ../..
bench update # to fetch requirements, build assets, and migrate database.

Replace [branch-name] with your desired branch (version-14 / version-14-hotfix / next). For instance, following commands will be applicable for version-14:

cd apps/india_compliance/
git remote set-branches upstream version-14
git fetch upstream version-14
git checkout -b version-14 --track upstream/version-14
cd ../..
bench update

Please feel free to post any queries here. And star us on GitHub if you like what we’ve built so far!

21 Likes

Renaming develop to next was a bad idea. develop branch is not expected to be stable.

I think you should rename this back to develop.

3 Likes

This had to be done, unfortunately. A lot of users had originally cloned the develop branch for stable v14 use. We erred on the side of breaking instead of risking these users downloading code applicable to an incorrect version.

Perhaps we can bring back the develop branch after giving these users due time to migrate to the version-14 branch.

Sorry for the inconvenience. Ideally, we should’ve started with the version-14 branch from day 1.

5 Likes

Breaking semantics is a bad idea. You could have still asked people to move to version-14 branch without renaming develop

3 Likes

I am getting following error while installing Indian compliance

erpnext@erpnext:~/frappe-bench$ bench get-app https://github.com/resilient-tech/india-compliance.git
Getting india-compliance
$ git clone https://github.com/resilient-tech/india-compliance.git  --depth 1 --origin upstream
Cloning into 'india-compliance'...
remote: Enumerating objects: 292, done.
remote: Counting objects: 100% (292/292), done.
remote: Compressing objects: 100% (258/258), done.
remote: Total 292 (delta 26), reused 189 (delta 23), pack-reused 0
Receiving objects: 100% (292/292), 615.95 KiB | 1.49 MiB/s, done.
Resolving deltas: 100% (26/26), done.
Ignoring dependencies of https://github.com/resilient-tech/india-compliance.git. To install dependencies use --resolve-deps
Installing india_compliance
$ /home/erpnext/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/erpnext/frappe-bench/apps/india_compliance 
$ bench build --app india_compliance
✔ Application Assets Linked                                                                                           


yarn run v1.22.19
$ node esbuild --production --apps india_compliance --run-build-command
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
✘ [ERROR] No matching export in "node_modules/vue-router/dist/vue-router.esm.js" for import "createRouter"

    ../india_compliance/india_compliance/public/js/india_compliance_account/router.js:1:9:
      1 │ import { createRouter, createWebHistory } from 'vue-router';
        ╵          ~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/vue-router/dist/vue-router.esm.js" for import "createWebHistory"

    ../india_compliance/india_compliance/public/js/india_compliance_account/router.js:1:23:
      1 │ import { createRouter, createWebHistory } from 'vue-router';
        ╵                        ~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/vuex/dist/vuex.esm.js" for import "createStore"

    ../india_compliance/india_compliance/public/js/india_compliance_account/store/index.js:1:9:
      1 │ import { createStore } from 'vuex'
        ╵          ~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/vue/dist/vue.runtime.esm.js" for import "createApp"

    ../india_compliance/india_compliance/public/js/india_compliance_account/india_compliance_account.bundle.js:1:9:
      1 │ import { createApp } from "vue";
        ╵          ~~~~~~~~~

 ERROR  There were some problems during build

Error: Build failed with 4 errors:
../india_compliance/india_compliance/public/js/india_compliance_account/india_compliance_account.bundle.js:1:9: ERROR: No matching export in "node_modules/vue/dist/vue.runtime.esm.js" for import "createApp"
../india_compliance/india_compliance/public/js/india_compliance_account/router.js:1:9: ERROR: No matching export in "node_modules/vue-router/dist/vue-router.esm.js" for import "createRouter"
../india_compliance/india_compliance/public/js/india_compliance_account/router.js:1:23: ERROR: No matching export in "node_modules/vue-router/dist/vue-router.esm.js" for import "createWebHistory"
../india_compliance/india_compliance/public/js/india_compliance_account/store/index.js:1:9: ERROR: No matching export in "node_modules/vuex/dist/vuex.esm.js" for import "createStore"
    at failureErrorWithLog (/home/erpnext/frappe-bench/apps/frappe/node_modules/esbuild/lib/main.js:1600:15)
    at /home/erpnext/frappe-bench/apps/frappe/node_modules/esbuild/lib/main.js:1246:28
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Terminated
error Command failed with exit code 143.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/utils.py", line 82, in build
    bundle(mode, apps=apps, hard_link=hard_link, verbose=verbose, skip_frappe=skip_frappe)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/build.py", line 257, in bundle
    frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env(), raise_err=True)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 98, in popen
    raise subprocess.CalledProcessError(return_, command)
subprocess.CalledProcessError: Command 'yarn run production --apps india_compliance --run-build-command' returned non-zero exit status 143.
ERROR: 
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/dist-packages/bench/cli.py", line 127, in cli
    bench_command()
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/commands/make.py", line 159, in get_app
    get_app(
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 444, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 242, in install
    install_app(
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 586, in install_app
    build_assets(bench_path=bench_path, app=app)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py", line 345, in build_assets
    exec_cmd(command, cwd=bench_path, env={"BENCH_DEVELOPER": "1"})
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/__init__.py", line 158, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError

You haven’t specified the correct branch, assuming you want to install for v14. Please refer to the installation instructions.

If you’re still facing issues, kindly open a new thread. I am closing this one.

Taking a page from Frappe HR, we have moved back to the develop branch and deprecated next. Those who were developing with the next branch can switch to the develop branch easily by running the following command:

bench switch-to-branch develop india_compliance
3 Likes
fatal: not a git repository (or any of the parent directories): .git

when i run to git remote set-branches upstream version-14

In which folder are you running this command? It needs to be run in the apps/india_compliance directory. If that’s not a git repository, you may not have installed it using the standard installation method.

in frappe-bench

You need to switch to the frappe-bench/apps/india_compliance as mentioned above.

ModuleNotFoundError: No module named 'redis.commands'

This is not a related issue. You’re digressing from the original topic so I’d recommend you to search existing topics or create a new topic instead.

Closing this topic.