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

Add case git #4655

Closed
wants to merge 17 commits into from
Closed

Add case git #4655

wants to merge 17 commits into from

Conversation

jedwards4b
Copy link
Contributor

This PR adds a case interface to git. It creates a local git repository when case.setup is run and updates that repository with each action that triggers an update of the CaseStatus file. Optionally a remote repository can be attached by setting CASE_GIT_REPOSITORY to the name of the remote repository. The case name is used as the repository branch name and if the branch already exists in the remote an error is generated. So multiple cases can exist in the same remote repository and each case is a branch of that repo. The new file gitinterface.py can interact with git in two ways:

  1. If the python git module is found it will be used.
  2. If the python git module is not found git commands will be run through shell commands.

Note that the variable CASE_GIT_REPOSITORY must be defined in your driver config_component.xml in order to use this feature, it should be defined as follows:

<entry id="CASE_GIT_REPOSITORY">
  <type>char</type>
   <default_value></default_value>
   <group>case_git</group>
   <file>env_build.xml</file>
   <desc>Remote git repository used for this case</desc>
</entry>

I have tested this code on three systems: derecho (with python git module)
izumi (without python git module)
TACC vista (grace-hopper system no python git module)

Test suite: scripts_regression_tests on the three systems listed above
Test baseline:
Test namelist changes:
Test status: bit for bit

User interface changes?: Users who wish to use the CASE_GIT_REPOSITORY feature must have write permissions to the remote repository and it is recommended that the ssh interface to that repository be used to avoid frequent prompts for github tokens.

Update gh-pages html (Y/N)?:

@jedwards4b jedwards4b marked this pull request as draft August 7, 2024 14:24
@jedwards4b jedwards4b self-assigned this Aug 7, 2024
Copy link
Member

@billsacks billsacks left a comment

Choose a reason for hiding this comment

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

This is awesome, @jedwards4b ! This is a really excellent feature to have! Thank you for implementing it!

Copy link
Contributor

@jgfouca jgfouca left a comment

Choose a reason for hiding this comment

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

Very cool idea for a feature!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets move this to CIME/data/templates/ with the other templates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, thanks.

@jasonb5
Copy link
Collaborator

jasonb5 commented Aug 8, 2024

I ran into one issue which is more of an edge case.
I was in a new environment, created a case and went to run ./case.setup.
image
Do we want to handle this before the case is created?

@jedwards4b
Copy link
Contributor Author

I'm not sure how to fix that - were you on a github server or in a local environment? I think that our github scripts set those git config variables don't they?

@jasonb5
Copy link
Collaborator

jasonb5 commented Aug 9, 2024

It was an environment in a container, but it could happen on any system where the user is new and hasn't setup git, since this is only required on making commits. This is really an edge case, I wouldn't expected it to happen often.

Should have a fix for this, soon.

Looking for: ['python=3.8']

Could not solve for environment specs
The following packages are incompatible
├─ python 3.8**  is requested and can be installed;
└─ truststore is not installable because it requires
   └─ python >=3.10  but there are no viable options
      ├─ python [3.10.0|3.10.1|...|3.12.5] conflicts with any installable versions previously reported;
      └─ python 3.12.0rc3 would require
         └─ _python_rc, which does not exist (perhaps a missing channel).

@jasonb5
Copy link
Collaborator

jasonb5 commented Aug 9, 2024

This PR #4658 should fix that error.

@jedwards4b jedwards4b mentioned this pull request Aug 9, 2024
@jedwards4b
Copy link
Contributor Author

Replaced by #4660

@jedwards4b jedwards4b closed this Aug 9, 2024
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