Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile with variable depth parameter (IDFGH-11513) #12637

Closed
wants to merge 3 commits into from

Conversation

timoxd7
Copy link
Contributor

@timoxd7 timoxd7 commented Nov 21, 2023

Problem

If a docker image is built from a branch that has a commit offset in respect to the last tag while using IDF_CLONE_SHALLOW, the git describe will fail returning "1".

Fix

Add another parameter to specify the depth instead of falling back to "1". If set to the offset of the commit +1, the git describe works again, still without cloning the whole repository. For custom IDF and development builds, this helps to get a working build version number again, instead of just "1" being put into the build es ESP IDF Version.

Backport

We use ESP-IDF v5.1.x, so a backport would be great.

Copy link

github-actions bot commented Nov 21, 2023

Messages
📖 You might consider squashing your 3 commits (simplifying branch history).

👋 Welcome timoxd7, thank you for your first contribution to espressif/esp-idf project!

📘 Please check Contributions Guide for the contribution checklist, information regarding code and documentation style, testing and other topics.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for espressif/esp-idf project.

Pull request review and merge process you can expect

Espressif develops the ESP-IDF project in an internal repository (Gitlab). We do welcome contributions in the form of bug reports, feature requests and pull requests via this public GitHub repository.

  1. An internal issue has been created for the PR, we assign it to the relevant engineer
  2. They review the PR and either approve it or ask you for changes or clarifications
  3. Once the Github PR is approved, we synchronize it into our internal git repository
  4. In the internal git repository we do the final review, collect approvals from core owners and make sure all the automated tests are passing
    • At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
  5. If the change is approved and passes the tests it is merged into the master branch
  6. On next sync from the internal git repository merged change will appear in this public Github repository

🔁 You can re-run automatic PR checks by retrying the DangerJS action

Generated by 🚫 dangerJS against 7cfdec1

@timoxd7
Copy link
Contributor Author

timoxd7 commented Nov 21, 2023

Fixed commit message as suggested

@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 21, 2023
@github-actions github-actions bot changed the title Dockerfile with variable depth parameter Dockerfile with variable depth parameter (IDFGH-11513) Nov 21, 2023
Copy link
Member

@igrr igrr left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @timoxd7! Could you please add a line about this variable also to the docs over here:

- ``IDF_CLONE_SHALLOW``: If this argument is set to a non-empty value, ``--depth=1 --shallow-submodules`` arguments are be used when performing ``git clone``. This significantly reduces the amount of data downloaded and the size of the resulting Docker image. However, if switching to a different branch in such a "shallow" repository is necessary, an additional ``git fetch origin <branch>`` command must be executed first.

@timoxd7
Copy link
Contributor Author

timoxd7 commented Nov 21, 2023

@igrr Forgot about that, i have added it to this pull request and the backport one.

@timoxd7 timoxd7 requested a review from igrr November 21, 2023 12:03
@igrr
Copy link
Member

igrr commented Nov 21, 2023

Thanks, looks good. Don't worry about the backport — since we will also need to update the Chinese version of the documentation (docs/zh_CN/api-guides/tools/idf-tools.rst), we will backport the final version together with the translation. We'll keep you as the commit author, of course.

@igrr igrr added the PR-Sync-Merge Pull request sync as merge commit label Nov 21, 2023
@igrr
Copy link
Member

igrr commented Nov 21, 2023

sha=7cfdec1649466ff5cb3363803f5f31424c986deb

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Nov 27, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: In Progress Work is in progress labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Sync-Merge Pull request sync as merge commit Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants