Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
validation_packages_test_index
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
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Schneider
validation_packages_test_index
Commits
c4032f4a
Commit
c4032f4a
authored
1 year ago
by
Kevin Schneider
Browse files
Options
Downloads
Patches
Plain Diff
lol
parent
fd8ae811
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test.fsx
+47
-0
47 additions, 0 deletions
test.fsx
with
47 additions
and
0 deletions
test.fsx
0 → 100644
+
47
−
0
View file @
c4032f4a
open
System
open
System
.
IO
open
System
.
Text
.
Json
type
ProcessResult
=
{
ExitCode
:
int
;
StdOut
:
string
;
StdErr
:
string
}
let
executeProcess
(
processName
:
string
)
(
processArgs
:
string
)
=
let
psi
=
new
Diagnostics
.
ProcessStartInfo
(
processName
,
processArgs
)
psi
.
UseShellExecute
<-
false
psi
.
RedirectStandardOutput
<-
true
psi
.
RedirectStandardError
<-
true
psi
.
CreateNoWindow
<-
true
let
proc
=
Diagnostics
.
Process
.
Start
(
psi
)
let
output
=
new
Text
.
StringBuilder
()
let
error
=
new
Text
.
StringBuilder
()
proc
.
OutputDataReceived
.
Add
(
fun
args
->
output
.
Append
(
args
.
Data
)
|>
ignore
)
proc
.
ErrorDataReceived
.
Add
(
fun
args
->
error
.
Append
(
args
.
Data
)
|>
ignore
)
proc
.
BeginErrorReadLine
()
proc
.
BeginOutputReadLine
()
proc
.
WaitForExit
()
{
ExitCode
=
proc
.
ExitCode
;
StdOut
=
output
.
ToString
()
;
StdErr
=
error
.
ToString
()
}
let
changed_files
=
File
.
ReadAllLines
(
"file_changes.txt"
)
|>
set
type
ValidationPackageIndex
=
{
Name
:
string
LastUpdated
:
System
.
DateTime
}
Directory
.
GetFiles
(
"validation_packages"
,
"*.fsx"
)
|>
Array
.
map
(
fun
package
->
if
changed_files
.
Contains
(
package
)
then
{
Name
=
package
;
LastUpdated
=
System
.
DateTime
.
Now
}
else
printfn
$
"{package} was changed in this commit."
let
history
=
executeProcess
"git"
$
"log -1 --pretty=format:%%ci {package}"
{
Name
=
package
;
LastUpdated
=
System
.
DateTime
.
ParseExact
(
history
.
StdOut
.
Split
(
" "
).[
0
],
"yyyy-MM-dd"
,
System
.
Globalization
.
CultureInfo
.
InvariantCulture
)}
)
|>
fun
packages
->
JsonSerializer
.
Serialize
(
packages
)
|>
fun
json
->
File
.
WriteAllText
(
"validation_packages.json"
,
json
)
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