diff --git a/django/library/github.py b/django/library/github.py index a84505187..ef05bc0db 100644 --- a/django/library/github.py +++ b/django/library/github.py @@ -239,6 +239,7 @@ def _create_org_repo(self): org = github.get_organization(settings.GITHUB_MODEL_LIBRARY_ORG_NAME) repo = org.create_repo( name=self.repo_name, + description=f"Mirror of {self.codebase.get_absolute_url()}", private=self.debug, ) return repo diff --git a/django/library/jinja2/library/cc_license_change.jinja b/django/library/jinja2/library/cc-license-change.jinja similarity index 100% rename from django/library/jinja2/library/cc_license_change.jinja rename to django/library/jinja2/library/cc-license-change.jinja diff --git a/django/library/jinja2/library/github-integration-overview.jinja b/django/library/jinja2/library/github-integration-overview.jinja new file mode 100644 index 000000000..7facb8daf --- /dev/null +++ b/django/library/jinja2/library/github-integration-overview.jinja @@ -0,0 +1,234 @@ +{% extends "base.jinja" %} + +{% block introduction %} +

Computational Model Library Github Integration

+{% endblock %} + +{% block content %} +
+
+
+
+
+
+

Mirroring

+

+ +

+
+

+ Mirroring transforms your model into a git repository and archives it on GitHub under the + + {{ github_model_library_org_name }} organization. +

+

+ Get started by clicking the + Mirror on GitHub button on + one of your models. +

+
+
+
+
+
+
+
+

Syncing (coming soon!)

+

+ +

+
+

+ Syncing will allow you to develop your model on GitHub and have any new releases + pulled back into the CoMSES Model Library. + +

+

+ Start from either a model on CoMSES or an existing GitHub repository. +

+
+
+
+
+ +
+

How It Works

+
+
+
    +
  • + +
    + Published model releases are transformed into commits + and releases on GitHub, preserving your project's history and versioning. +
    +
  • +
  • + +
    + The original submitter is set as the commit + author, maintaining attribution. +

    + {% if not user.is_authenticated %} + We will use a connected Github account or your profile information to sign commits. + You can + connect + your Github account by editing your profile if you want it to appear as the author + of the + commits. + {% elif user.member_profile.github_username %} + Since you have a connected Github account, we will use it to sign commits: + {{ user.member_profile.github_username }} <{{ user.member_profile.github_username }}@users.noreply.github.com> + {% else %} + Since you do not have a github account connected we will use your profile + information: + {{ user.member_profile.name }} <{{ user.email }}> + {% endif %} +

    +
    +
  • +
  • + +
    + Metadata is preserved by adding to the GitHub repo where possible and stored in + versioned + codemeta.json, + LICENSE, + and CITATION.cff files. +
    +
  • +
  • + +
    + Each time a new release is published on the Model Library, the GitHub repository is + updated automatically. +
    +
  • +
+
+
+
+
+
    +
  • + +
    + When enabled on a CoMSES model, the model is transformed into a git repository + with the same process as mirroring but the repository will be created under your + GitHub account. +
    +
  • +
  • + +
    + Alternatively, you can start from an existing GitHub repository and import it into + the Model Library. +
    +
  • +
  • + +
    + When you are ready to publish a new release, update the software's metadata + and create a new release on GitHub. The Model Library will automatically pull in the + new release. +
    +
  • +
+
+
+
+ +
+

Benefits

+
+
+
    +
  • + +
    + Automatically transition your model codebase to the most commonly used + version control system +
    +
  • +
  • + +
    + Provide better access to your model's source with GitHub's code browser +
    +
  • +
+
+
+
+
+
    +
  • + +
    + Collaborate with other researchers using GitHub's rich collaboration and project + management environment +
    +
  • +
  • + +
    + Take advantage of tools available as GitHub apps + and actions +
    +
  • +
+
+
+
+ +
+

Limitations

+
+
+
    +
  • + +
    + Individual files cannot exceed 100MB +
    +
  • +
  • + +
    + Mirrored repositories are read-only, though you are free to fork them +
    +
  • +
+
+
+
+
+
    +
  • + +
    + Individual files cannot exceed 100MB +
    +
  • +
  • + +
    + Required metadata must be present in order to pull in new releases from GitHub +
    +
  • +
  • + +
    + Changes cannot be made to the CoMSES Model Library record when there are conflicting + changes on GitHub +
    +
  • +
+
+
+
+
+{% endblock %} diff --git a/django/library/models.py b/django/library/models.py index 88da19bfb..95f9269ba 100644 --- a/django/library/models.py +++ b/django/library/models.py @@ -549,13 +549,8 @@ def updated_after(self, start_date, end_date=None, **kwargs): class CodebaseGitMirror(models.Model): """ - # FIXME: should this manage both mirroring and syncing? - alt name ideas: - - CodebaseGithubIntegration - - CodebaseGitRepository - mirror makes sense if this is only responsible for the mirroring (1-way workflow) - - model to keep track of the state of a git repository for a codebase + Keeps track of a git repository and its GitHub remote that were created + from a Codebase using the mirror (read-only archiving) workflow """ # is_active = models.BooleanField(default=True) diff --git a/django/library/urls.py b/django/library/urls.py index d03be3b80..ed25c6323 100644 --- a/django/library/urls.py +++ b/django/library/urls.py @@ -46,6 +46,16 @@ ) urlpatterns = [ + path( + "github/", + TemplateView.as_view( + template_name="library/github-integration-overview.jinja", + extra_context={ + "github_model_library_org_name": settings.GITHUB_MODEL_LIBRARY_ORG_NAME, + }, + ), + name="github-integration-overview", + ), path( "reviews/", TemplateView.as_view(template_name="library/review/peer-review-overview.jinja"), diff --git a/django/library/views.py b/django/library/views.py index 8febc0300..d9d3f0df3 100644 --- a/django/library/views.py +++ b/django/library/views.py @@ -1178,7 +1178,7 @@ class ContributorList(generics.ListAPIView): class CCLicenseChangeView(LoginRequiredMixin, FormView): - template_name = "library/cc_license_change.jinja" + template_name = "library/cc-license-change.jinja" form_class = Form # just a confirmation form, we don't need any fields success_message = "Licenses updated successfully." diff --git a/frontend/src/components/GithubMirrorModal.vue b/frontend/src/components/GithubMirrorModal.vue index 9e987fda3..0bb90856d 100644 --- a/frontend/src/components/GithubMirrorModal.vue +++ b/frontend/src/components/GithubMirrorModal.vue @@ -1,6 +1,7 @@