Skip to content

Improve user experience with better manifest errors messages#1229

Merged
mosteo merged 4 commits into
masterfrom
did_you_mean
Nov 17, 2022
Merged

Improve user experience with better manifest errors messages#1229
mosteo merged 4 commits into
masterfrom
did_you_mean

Conversation

@Fabien-Chouteau

Copy link
Copy Markdown
Member

This is patch introduces suggestions in various error messages from the manifest parser. A potential suggestion is made using edit distance computing from a list of possible values. If the quality is not deemed good enough, the full list of values is printed.

This is patch introduces suggestions in various error messages
from the manifest parser. A potential suggestion is made using
edit distance computing from a list of possible values. If the
quality is not deemed good enough, the full list of values is
printed.
@mosteo

mosteo commented Oct 26, 2022

Copy link
Copy Markdown
Member

Very cool!

@Fabien-Chouteau

Copy link
Copy Markdown
Member Author

@mosteo somethings wrong with the macOS CI. I don't think they updated the macos-latest version. Maybe it's GNAT 12.2...

@mosteo

mosteo commented Nov 9, 2022

Copy link
Copy Markdown
Member

I see... Strange, and different in each macOS setup. No immediate ideas to offer :/

@Fabien-Chouteau

Copy link
Copy Markdown
Member Author

@simonjwright we have some issues on macOS that I don't understand, in case you have some time to give it a look.

@simonjwright

Copy link
Copy Markdown
Contributor

I can find the tests, and I can run them locally, and I see failures. What I can’t see is how to run an individual test in diagnostic mode (i.e. so I can see what went wrong in detail).

@Fabien-Chouteau

Copy link
Copy Markdown
Member Author

-v -E for more detailed output and path to folder to filter tests e.g. tests/misc/did-you-mean

So ./run.py -v -E tests/misc/did-you-mean

@simonjwright

Copy link
Copy Markdown
Contributor

Here are the tests which failed when run together from the top level.

publish__check-pre-release-version

PASS

publish__local-repo

FAIL
_Output:
_Initialized empty Git repository in /private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmpzy5hjtqu/publish__local-repo/xxx/.git/
_[main (root-commit) 915db17] repo created
_ 9 files changed, 134 insertions(+)
_ create mode 100644 .gitignore
_ create mode 100644 alire.toml
_ create mode 100644 alire/alire.lock
_ create mode 100644 alire/config.toml
_ create mode 100644 config/xxx_config.ads
_ create mode 100644 config/xxx_config.gpr
_ create mode 100644 config/xxx_config.h
_ create mode 100644 src/xxx.adb
_ create mode 100644 xxx.gpr
_Cloning into 'xxx_local'...
_done.
_The following command:
_ alr -q -d -n --force publish . master
_Exitted with status code 1
_Output:
_stderr: Command ["git", "log", "master", "-n1", "--oneline", "--no-abbrev-commit"] exited with code 128 and output: fatal: ambiguous argument 'master': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git [...] -- [...]'
_stderr: Revision not found in local repository: master
_ERROR: Revision not found in local repository: master
_
_Traceback (most recent call last):
_ File "/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmpzy5hjtqu/publish__local-repo/test.py", line 40, in
_ run_alr("--force", "publish", ".", "master")
_ File "/Users/simon/Developer/alire/testsuite/drivers/alr.py", line 112, in run_alr
_ raise CalledProcessError('alr returned non-zero status code')
_drivers.alr.CalledProcessError: alr returned non-zero status code

misc__did-you-mean

PASS

publish__local-repo-nonstd

FAIL
_Initialized empty Git repository in /private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmp_g19jvr1/publish__local-repo-nonstd/xxx/.git/
_[main (root-commit) 60ca0f5] repo created
_ 9 files changed, 134 insertions(+)
_ create mode 100644 .gitignore
_ create mode 100644 alire/alire.lock
_ create mode 100644 alire/config.toml
_ create mode 100644 config/xxx_config.ads
_ create mode 100644 config/xxx_config.gpr
_ create mode 100644 config/xxx_config.h
_ create mode 100644 src/xxx.adb
_ create mode 100644 xxx.gpr
_ create mode 100644 xxx.toml
_Cloning into 'xxx_local'...
_done.
_The following command:
_ alr -q -d -n --force publish . master --manifest xxx.toml
_Exitted with status code 1
_Output:
_stderr: Command ["git", "log", "master", "-n1", "--oneline", "--no-abbrev-commit"] exited with code 128 and output: fatal: ambiguous argument 'master': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git [...] -- [...]'
_stderr: Revision not found in local repository: master
_ERROR: Revision not found in local repository: master
_
_Traceback (most recent call last):
_ File "/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmp_g19jvr1/publish__local-repo-nonstd/test.py", line 42, in
_ run_alr("--force", "publish", ".", "master", "--manifest", "xxx.toml")
_ File "/Users/simon/Developer/alire/testsuite/drivers/alr.py", line 112, in run_alr
_ raise CalledProcessError('alr returned non-zero status code')
_drivers.alr.CalledProcessError: alr returned non-zero status code

index__branch-mismatch

FAIL
_Traceback (most recent call last):
_ File "/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmp18xmgrcf/index__branch-mismatch/test.py", line 35, in
_ assert_match(".This alr build expects an index branch with prefix '.'"
_ File "/Users/simon/Developer/alire/testsuite/drivers/asserts.py", line 61, in assert_match
_ assert False, '\n'.join(text)
_AssertionError: Unexpected output
_Expecting a match on:
_ ".This alr build expects an index branch with prefix '.' but your community index branch is 'master'.*"
_But got:
_ "warning: This alr build expects an index branch with prefix 'stable' but your community index branch is 'main'"
_ "warning: You can disable this warning with configuration key 'warning.old_index'"
_ "warning: Index 'community' version (1.1.0) is older than the newest supported by alr (1.2.1)"
_ "warning: You can disable this warning with configuration key 'warning.old_index'"
_ "Note: If you experience any problems loading this index, you may need to reset the community index with 'alr index --reset-community'. Note that this operation will delete any local changes to the community index."
_ 'No hits'

misc__local-reject-origin

PASS

build_profile__default

PASS

@Fabien-Chouteau

Copy link
Copy Markdown
Member Author

Looks like you don't have the same errors as we have on the GitHub CI.

@simonjwright

Copy link
Copy Markdown
Contributor

My trouble seems to be that I’m running git version 2.37.0 (Apple Git-136) which defaults the initial branch to main, so that’s what helpers.py/init_git_repo() does; and the tests expect the branch to be master.

@mosteo

mosteo commented Nov 16, 2022

Copy link
Copy Markdown
Member

the tests expect the branch to be master

Ohhh well spotted.

@simonjwright

Copy link
Copy Markdown
Contributor

I’m getting a PR together. Running CI in my repo now.

@simonjwright

Copy link
Copy Markdown
Contributor

Gosh it’s slow! the macos runner took 1h7m to install the toolchain, and has already spent an hour in Run test script (without Homebrew) and is still compiling alire-releases.adb.

@simonjwright

Copy link
Copy Markdown
Contributor

I spoke too soon. See PR #1244.

@mosteo

mosteo commented Nov 17, 2022

Copy link
Copy Markdown
Member

So by merging this we are going temporarily with the old macOS version, right? At least it buys us some time.

@mosteo mosteo merged commit e24486c into master Nov 17, 2022
@mosteo mosteo deleted the did_you_mean branch November 17, 2022 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants