Git Product home page Git Product logo

Comments (12)

Ari1009 avatar Ari1009 commented on July 1, 2024 1

@Ari1009 I have opened a new PR to fix this issue, would you like to help verify that changes resolves the issue.

Yes, thank you. This fixes the issue that I faced.

from oppia.

jayam04 avatar jayam04 commented on July 1, 2024

@Shriyam-Avasthi It's strange .git isn't copied in Docker container, could you please rebuild it by following.

  1. make clean
  2. make build

Also, can you tell in which system this occurred. Also just to check, git diff <file> gives expected output in local environment.
Also could you list files and folders in .git in Docker by running:

  1. make run-devserver
  2. docker compose exec -it dev-server /bin/bash
  3. ls -al .git (it should be run in bash of Docker container)

from oppia.

Shriyam-Avasthi avatar Shriyam-Avasthi commented on July 1, 2024

@jayam04

1. `make clean`

2. `make build`

Already done that, still the bug persists.

Also, can you tell in which system this occurred.

I am using WSL2.

Also just to check, git diff <file> gives expected output in local environment.

git diff core/feconf.py runs without any output, however git diff --staged returns the expected output

image

Also could you list files and folders in .git in Docker by running:

1. `make run-devserver`

2. `docker compose exec -it dev-server /bin/bash`

3. `ls -al .git` (it should be run in bash of Docker container)

image

from oppia.

jayam04 avatar jayam04 commented on July 1, 2024

@Shriyam-Avasthi I have confirmed bug occurs in WSL, thanks for bringing it. Being busy, I need some time to find proper fix to it. But till then I found temporary solution which you can use, so this issue doesn't stop you from contributing. Please do following:

  1. make run-devserver
  2. docker compose exec -it dev-server /bin/bash
  3. git config --global --add safe.directory /app/oppia (inside Docker container)

Please, reply if solution works or even if you need any further help.

from oppia.

Shriyam-Avasthi avatar Shriyam-Avasthi commented on July 1, 2024

@jayam04
Thank you for helping out. Following your instructions, I am able to commit changes locally. Now, I am facing another issue, running git push leads to frontend tests failed error , whereas if I run the tests using make run_tests.frontend all tests work. I have worked on a very basic fix (just fixing a button) and I dont feel something like that should cause the frontend tests to fail. Here are the terminal outputs for reference:

  • Using git push

image

  • Using make run_tests.frontend

image

Additionally, just to be sure, I went ahead and created another branch and modified only the following piece of code, in essence, just adding a && true condition, which should not lead to any functionality changes. But this also leads to the same frontend test failed error.

    isDiagramCreated(): boolean {
    // This function checks if any shape has been created or not.
    return Boolean(
      !this.isUserDrawing() &&
        this.diagramStatus === this.STATUS_EDITING &&
        this.canvas &&
        this.canvas.getObjects().length > 0
    );
  }

to

    isDiagramCreated(): boolean {
    // This function checks if any shape has been created or not.
    return Boolean(
      !this.isUserDrawing() &&
        this.diagramStatus === this.STATUS_EDITING &&
        this.canvas &&
        this.canvas.getObjects().length > 0 &&
        true
    );
  }

image

from oppia.

Ari1009 avatar Ari1009 commented on July 1, 2024

I face the same issue. My OS is Arch Linux with Hyprland. I made a single CSS file change just to test, but when I try to commit it, an error pops up.

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
Running docker compose exec -T dev-server  python3 ./.git/hooks/pre-commit-python 
time="2024-05-23T17:29:18+05:30" level=warning msg="/run/media/deku09/fad336b5-383a-49f4-805c-1a9a3e3db54e1/lost+found/Contributions/oppia/docker-compose.yml: `version` is obsolete"
[STARTED] Preparing lint-staged...
[FAILED] 
[FAILED] *** Please tell me who you are.
[FAILED] 
[FAILED] Run
[FAILED] 
[FAILED]   git config --global user.email "[email protected]"
[FAILED]   git config --global user.name "Your Name"
[FAILED] 
[FAILED] to set your account's default identity.
[FAILED] Omit --global to set the identity only in this repository.
[FAILED] 
[FAILED] fatal: unable to auto-detect email address (got 'unknown@c14d993fa07f.(none)')
[FAILED] Cannot save the current index state
[STARTED] Running tasks for staged files...
[SKIPPED] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
[SKIPPED] 
[SKIPPED]   ✖ lint-staged failed due to a git error.
[STARTED] Cleaning up temporary files...
[SKIPPED] 
[SKIPPED]   ✖ lint-staged failed due to a git error.

  ✖ lint-staged failed due to a git error.
  Any lost modifications can be restored from a git stash:

    > git stash list
    stash@{0}: automatic lint-staged backup
    > git stash apply --index stash@{0}

Running pre-commit check for feconf and constants ...
Running pre-commit check for package-lock.json ...
Running prettier ...
Traceback (most recent call last):
  File "./.git/hooks/pre-commit-python", line 229, in <module>
    main()
  File "./.git/hooks/pre-commit-python", line 221, in main
    run_prettier()
  File "./.git/hooks/pre-commit-python", line 189, in run_prettier
    subprocess.run('npx lint-staged', shell=True, check=True)
  File "/usr/local/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'npx lint-staged' returned non-zero exit status 1.
Python script exited with code 1

from oppia.

jayam04 avatar jayam04 commented on July 1, 2024

@Ari1009 Above issue is resolved in #19962 but not yet commited. Could you please update git username and email in Docker Container manually.

You can do it by running:

  1. docker compose exec -T dev-server git config user.name $(git config user.name)
  2. docker compose exec -T dev-server git config user.email $(git config user.email)

from oppia.

jayam04 avatar jayam04 commented on July 1, 2024

@Ari1009 You mentioned failing pre-push due to frontend tests, could you please tell if you are still facing it or not?

from oppia.

Ari1009 avatar Ari1009 commented on July 1, 2024

@Ari1009 Above issue is resolved in #19962 but not yet commited. Could you please update git username and email in Docker Container manually.

You can do it by running:

1. `docker compose exec -T dev-server git config user.name $(git config user.name)`

2. `docker compose exec -T dev-server git config user.email $(git config user.email)`

Thanks, this works

from oppia.

Ari1009 avatar Ari1009 commented on July 1, 2024

I'm also facing another issue. I made some changes in .assets/constants.ts, but when I try to commit, this error pops up.

Running docker compose exec -T dev-server  python3 ./.git/hooks/pre-commit-python 
WARN[0000] /run/media/deku09/fad336b5-383a-49f4-805c-1a9a3e3db54e1/lost+found/Contributions/oppia/docker-compose.yml: `version` is obsolete 
Not a git repository
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>
Running pre-commit check for feconf and constants ...
Traceback (most recent call last):
  File "./.git/hooks/pre-commit-python", line 229, in <module>
    main()
  File "./.git/hooks/pre-commit-python", line 206, in main
    check_changes_in_config()
  File "./.git/hooks/pre-commit-python", line 176, in check_changes_in_config
    if not check_changes('feconf'):
  File "./.git/hooks/pre-commit-python", line 160, in check_changes
    diff_output = subprocess.check_output([
  File "/usr/local/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'diff', 'core/feconf.py']' returned non-zero exit status 129.
Python script exited with code 1

from oppia.

jayam04 avatar jayam04 commented on July 1, 2024

@Ari1009 have you tried solution here

from oppia.

jayam04 avatar jayam04 commented on July 1, 2024

@Ari1009 I have opened a new PR to fix this issue, would you like to help verify that changes resolves the issue.

from oppia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.