Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CADET-RDM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IBG-1
ModSim
CADET
CADET-RDM
Commits
b71d2f18
Commit
b71d2f18
authored
1 year ago
by
Ronald Jäpel
Browse files
Options
Downloads
Patches
Plain Diff
Restructure log.csv for better readability
parent
4c4a2891
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cadetrdm/initialize_repo.py
+1
-1
1 addition, 1 deletion
cadetrdm/initialize_repo.py
cadetrdm/repositories.py
+14
-12
14 additions, 12 deletions
cadetrdm/repositories.py
with
15 additions
and
13 deletions
cadetrdm/initialize_repo.py
+
1
−
1
View file @
b71d2f18
...
...
@@ -169,7 +169,7 @@ def initialize_from_remote(project_url, path_to_repo: str = None):
with
open
(
json_path
,
"
r
"
)
as
file_handle
:
meta_dict
=
json
.
load
(
file_handle
)
output_folder_name
=
os
.
path
.
join
(
path_to_repo
,
meta_dict
[
"
output_foldername
"
])
output_folder_name
=
os
.
path
.
join
(
path_to_repo
,
meta_dict
[
"
output_folder
_
name
"
])
ssh_remotes
=
list
(
meta_dict
[
"
output_remotes
"
].
values
())
http_remotes
=
[
ssh_url_to_http_url
(
url
)
for
url
in
ssh_remotes
]
for
output_remote
in
ssh_remotes
+
http_remotes
:
...
...
This diff is collapsed.
Click to expand it.
cadetrdm/repositories.py
+
14
−
12
View file @
b71d2f18
...
...
@@ -328,8 +328,8 @@ class ProjectRepo(BaseRepo):
:return: the new branch name
"""
project_repo_hash
=
str
(
self
.
head
.
commit
)
timestamp
=
datetime
.
now
().
strftime
(
"
%Y-%m-%d
-
%H-%M-%S
-%f
"
)[:
-
4
]
branch_name
=
"
_
"
.
join
([
str
(
self
.
active_branch
),
project_repo_hash
[:
7
],
self
.
output_folder
,
timestamp
])
timestamp
=
datetime
.
now
().
strftime
(
"
%Y-%m-%d
_
%H-%M-%S
"
)
branch_name
=
"
_
"
.
join
([
self
.
output_folder
,
"
from
"
,
str
(
self
.
active_branch
),
project_repo_hash
[:
7
],
timestamp
])
return
branch_name
def
check_results_master
(
self
):
...
...
@@ -345,7 +345,7 @@ class ProjectRepo(BaseRepo):
"""
self
.
_output_repo
.
_git
.
checkout
(
self
.
_most_recent_branch
)
def
update_output_master_logs
(
self
,
message
=
None
):
def
update_output_master_logs
(
self
,
):
"""
Dumps all the metadata information about the project repositories state and
the commit hash and branch name of the ouput repository into the master branch of
...
...
@@ -354,6 +354,7 @@ class ProjectRepo(BaseRepo):
output_branch_name
=
str
(
self
.
_output_repo
.
active_branch
)
output_repo_hash
=
str
(
self
.
_output_repo
.
head
.
commit
)
output_commit_message
=
self
.
_output_repo
.
active_branch
.
commit
.
message
self
.
_output_repo
.
_git
.
checkout
(
"
master
"
)
...
...
@@ -366,12 +367,14 @@ class ProjectRepo(BaseRepo):
# this also has to be changed in the gitattributes of the init repo func
csv_filepath
=
os
.
path
.
join
(
logs_folderpath
,
"
log.csv
"
)
meta_info_dict
=
{
"
Output repo branch
"
:
output_branch_name
,
"
Output repo commit hash
"
:
output_repo_hash
,
"
Project repo commit hash
"
:
str
(
self
.
head
.
commit
),
"
Project repo folder name
"
:
os
.
path
.
split
(
self
.
working_dir
)[
-
1
],
"
Project repo remotes
"
:
[
str
(
remote
.
url
)
for
remote
in
self
.
remotes
],
}
meta_info_dict
=
{
"
Output repo commit message
"
:
output_commit_message
,
"
Output repo branch
"
:
output_branch_name
,
"
Output repo commit hash
"
:
output_repo_hash
,
"
Project repo commit hash
"
:
str
(
self
.
head
.
commit
),
"
Project repo folder name
"
:
os
.
path
.
split
(
self
.
working_dir
)[
-
1
],
"
Project repo remotes
"
:
[
str
(
remote
.
url
)
for
remote
in
self
.
remotes
],
}
csv_header
=
"
,
"
.
join
(
meta_info_dict
.
keys
())
csv_data
=
"
,
"
.
join
([
str
(
x
)
for
x
in
meta_info_dict
.
values
()])
...
...
@@ -399,9 +402,8 @@ class ProjectRepo(BaseRepo):
self
.
copy_code
(
code_copy_folderpath
)
self
.
_output_repo
.
add
(
"
.
"
)
if
message
is
None
:
message
=
output_branch_name
self
.
_output_repo
.
_git
.
commit
(
"
-m
"
,
message
)
self
.
_output_repo
.
_git
.
commit
(
"
-m
"
,
f
"
log for
'
{
output_commit_message
}
'
\n
"
f
"
of branch
'
{
output_branch_name
}
'"
)
self
.
_output_repo
.
_git
.
checkout
(
output_branch_name
)
self
.
_most_recent_branch
=
output_branch_name
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment