Skip to content

Conversation

@tdesveaux
Copy link
Contributor

@tdesveaux tdesveaux commented Apr 23, 2025

Current code rely a lot on the Giteapy package to query our Gitea instance's API to retrieve commit order used to define which artifact is the newest.

Giteapy instantiation here check for a "gitea env" with check_for_gitea_env, which itself look if current env.branch is in a manually maintained list project_branches in the project .nimp.conf.

On a new branch, CI jobs fail with [ERROR] Revision seems to be a git commit hash but missing gitea api information. Please check project_branches in project configuration.

A quick fix would be to add the branch to the configuration branches, but it's better to remove this unnecessary limitation altogether.

This also add:

  • improvement the logic to use the topological order of the commits instead of their date.
  • some fastpath for common --revision and --max-revision cases.
  • some typing

@tdesveaux tdesveaux requested review from ftith and jasugun April 23, 2025 15:21
@tdesveaux tdesveaux force-pushed the tds/improve-artifact-git branch from f40419d to fcbed80 Compare April 23, 2025 15:28
@tdesveaux tdesveaux force-pushed the tds/improve-artifact-git branch from fcbed80 to a7948c9 Compare April 23, 2025 15:34
@jasugun
Copy link
Contributor

jasugun commented Apr 23, 2025

Not sure how much of a problem it is but download command fails when not admin

c:\monorepo\Game\PIO(dev -> origin)
λ nimp --branch dev download-fileset binaries_version --dry-run
  File "D:\dne_tools\nimp\nimp\base_commands\download_fileset.py", line 250, in _get_newest_revision
    subprocess.check_call(['git', 'init', 'bare', tmp_git_dir])
  File "C:\Users\l.cahour\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'init', 'bare', 'C:\\Users\\LD8EE~1.CAH\\AppData\\Local\\Temp\\nimp_git_6bvgzu9_']' returned non-zero exit status 129.

@tdesveaux tdesveaux force-pushed the tds/improve-artifact-git branch 2 times, most recently from 47c4c43 to 4dabaaf Compare April 24, 2025 12:18
@tdesveaux tdesveaux marked this pull request as ready for review April 24, 2025 12:21

subprocess.check_call(['git', 'remote', 'add', 'origin', remote], cwd=tmp_git_dir)

# if current workdir contains a git repo, use it as alternate to prevent unnecessary burden on remote
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@tdesveaux tdesveaux force-pushed the tds/improve-artifact-git branch from 4dabaaf to 727c825 Compare April 24, 2025 13:47
@tdesveaux tdesveaux merged commit 86404ba into main Apr 24, 2025
7 checks passed
@tdesveaux tdesveaux deleted the tds/improve-artifact-git branch April 24, 2025 13:50
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.

4 participants